pub struct RingElement { /* private fields */ }Expand description
Typed ring-element input handle. Runtime bytes follow Amendment 43 §2’s canonical-bytes layout, stored in a fixed-size stack buffer.
Implementations§
Source§impl RingElement
impl RingElement
Sourcepub fn from_components(
witt_level: u8,
coefficient: u64,
) -> Result<Self, ShapeViolation>
pub fn from_components( witt_level: u8, coefficient: u64, ) -> Result<Self, ShapeViolation>
Construct a RingElement from explicit Witt level + coefficient.
Sourcepub fn parse(raw: &[u8]) -> Result<Self, ShapeViolation>
pub fn parse(raw: &[u8]) -> Result<Self, ShapeViolation>
Parse raw canonical-bytes into a typed RingElement.
Sourcepub fn tagged_bytes(&self) -> &[u8] ⓘ
pub fn tagged_bytes(&self) -> &[u8] ⓘ
Borrow the canonical-bytes byte sequence.
Sourcepub fn witt_level(&self) -> u8
pub fn witt_level(&self) -> u8
The element’s Witt level (first byte of the canonical layout).
Trait Implementations§
Source§impl Clone for RingElement
impl Clone for RingElement
Source§fn clone(&self) -> RingElement
fn clone(&self) -> RingElement
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl ConstrainedTypeShape for RingElement
impl ConstrainedTypeShape for RingElement
Source§const IRI: &'static str = "https://uor.foundation/addr/RingElement"
const IRI: &'static str = "https://uor.foundation/addr/RingElement"
IRI of the ontology
type:ConstrainedType instance this shape represents.Source§const SITE_COUNT: usize = 1
const SITE_COUNT: usize = 1
Number of sites (fields) this constrained type carries.
Source§const CONSTRAINTS: &'static [ConstraintRef]
const CONSTRAINTS: &'static [ConstraintRef]
Per-site constraint list. Empty means unconstrained.
Source§const CYCLE_SIZE: u64 = u64::MAX
const CYCLE_SIZE: u64 = u64::MAX
ADR-032: cardinality of the shape’s value-set (the cycle
structure of the shape under the substrate’s discrete-clock
model). Used by the
prism_model! macro to lower first_admit
(closure-body grammar G16) to the correct descent measure.
Conventions: Read more§const SITE_BUDGET: usize = Self::SITE_COUNT
const SITE_BUDGET: usize = Self::SITE_COUNT
Ontology-level
siteBudget: count of data sites only,
excluding bookkeeping introduced by composition (coproduct tag
sites, etc.). Equals SITE_COUNT for leaf shapes and for
shapes whose composition introduces no bookkeeping (products,
cartesian products). Strictly less than SITE_COUNT for coproduct
shapes and any shape whose SITE_COUNT includes inherited
bookkeeping. Introduced by the Product/Coproduct Completion
Amendment §4a; defaults to SITE_COUNT so pre-amendment
shape impls remain valid without edits.Source§impl Debug for RingElement
impl Debug for RingElement
Source§impl<'a> IntoBindingValue<'a> for RingElement
impl<'a> IntoBindingValue<'a> for RingElement
Source§fn as_binding_value<const INLINE_BYTES: usize>(
&self,
) -> TermValue<'a, INLINE_BYTES>
fn as_binding_value<const INLINE_BYTES: usize>( &self, ) -> TermValue<'a, INLINE_BYTES>
Return this input value’s canonical content-addressable bytes as a
source-polymorphic [
crate::pipeline::TermValue] carrier (ADR-060).
Inline for values within the derived inline width, Borrowed for
larger in-memory values (zero-copy), or Stream for unbounded
sources. The carrier borrows the input’s 'a-lived data; for an
Inline-only input it owns its bytes and is valid for any 'a.Source§impl PartialEq for RingElement
impl PartialEq for RingElement
Source§impl PartitionProductFields for RingElement
impl PartitionProductFields for RingElement
Source§const FIELDS: &'static [(u32, u32)]
const FIELDS: &'static [(u32, u32)]
Per-factor
(byte_offset, byte_length) pairs in declaration
order. Length is the same as FIELD_NAMES.len().Source§const FIELD_NAMES: &'static [&'static str]
const FIELD_NAMES: &'static [&'static str]
Per-factor names. Empty string
"" for positional-only
partition_product!(Name, A, B) emissions; non-empty for
named-field partition_product!(Name, lhs: A, rhs: B) form.
Length matches FIELDS.len().§fn field_index_by_name(name: &str) -> usize
fn field_index_by_name(name: &str) -> usize
Linear search returning the field index whose
FIELD_NAMES
entry equals name, or usize::MAX if not found. Delegates
to the free const fn [field_index_by_name_in] so the
result is usable inside const-eval contexts on stable Rust
1.83 (where const trait methods are unavailable).impl Eq for RingElement
impl Sealed for RingElement
Auto Trait Implementations§
impl Freeze for RingElement
impl RefUnwindSafe for RingElement
impl Send for RingElement
impl Sync for RingElement
impl Unpin for RingElement
impl UnsafeUnpin for RingElement
impl UnwindSafe for RingElement
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more