pub struct BigIntShape<const BYTES: usize>;Expand description
Parametric ConstrainedTypeShape: an N-byte big-endian integer.
Per ADR-031 this is the canonical Layer-3 shape downstream
prism_model! invocations use to type their Input / Output as
big-integer values. The shape carries BYTES sites with no
admission constraints; admission discipline (range bounds, modulus,
etc.) is the consumer’s responsibility through additional
constraint refs.
Per ADR-017’s closure rule the IRI is the foundation’s shared
ConstrainedType class; instance identity flows through
(SITE_COUNT, CONSTRAINTS).
Trait Implementations§
Source§impl<const BYTES: usize> Clone for BigIntShape<BYTES>
impl<const BYTES: usize> Clone for BigIntShape<BYTES>
Source§fn clone(&self) -> BigIntShape<BYTES>
fn clone(&self) -> BigIntShape<BYTES>
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<const BYTES: usize> ConstrainedTypeShape for BigIntShape<BYTES>
impl<const BYTES: usize> ConstrainedTypeShape for BigIntShape<BYTES>
Source§const IRI: &'static str = "https://uor.foundation/type/ConstrainedType"
const IRI: &'static str = "https://uor.foundation/type/ConstrainedType"
IRI of the ontology
type:ConstrainedType instance this shape represents.Source§const SITE_COUNT: usize = BYTES
const SITE_COUNT: usize = BYTES
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
const CYCLE_SIZE: u64
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 moreSource§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<const BYTES: usize> Debug for BigIntShape<BYTES>
impl<const BYTES: usize> Debug for BigIntShape<BYTES>
Source§impl<const BYTES: usize> Default for BigIntShape<BYTES>
impl<const BYTES: usize> Default for BigIntShape<BYTES>
Source§fn default() -> BigIntShape<BYTES>
fn default() -> BigIntShape<BYTES>
Returns the “default value” for a type. Read more
Source§impl<const BYTES: usize> IntoBindingValue for BigIntShape<BYTES>
impl<const BYTES: usize> IntoBindingValue for BigIntShape<BYTES>
Source§const MAX_BYTES: usize = BYTES
const MAX_BYTES: usize = BYTES
Maximum byte length any value of this shape can produce when
serialized via [
into_binding_bytes]. Used by run_route to
size the on-stack buffer and reject inputs that would overflow.Source§fn into_binding_bytes(&self, _out: &mut [u8]) -> Result<usize, ShapeViolation>
fn into_binding_bytes(&self, _out: &mut [u8]) -> Result<usize, ShapeViolation>
Serialize this input value into the binding-table form.
out is a
fixed-capacity buffer the call-site provides; the implementation
writes the canonical content-addressable byte sequence and returns
the written length. Read moreSource§impl<const BYTES: usize> PartitionProductFields for BigIntShape<BYTES>
impl<const BYTES: usize> PartitionProductFields for BigIntShape<BYTES>
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().Source§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<const BYTES: usize> Copy for BigIntShape<BYTES>
impl<const BYTES: usize> GroundedShape for BigIntShape<BYTES>
Auto Trait Implementations§
impl<const BYTES: usize> Freeze for BigIntShape<BYTES>
impl<const BYTES: usize> RefUnwindSafe for BigIntShape<BYTES>
impl<const BYTES: usize> Send for BigIntShape<BYTES>
impl<const BYTES: usize> Sync for BigIntShape<BYTES>
impl<const BYTES: usize> Unpin for BigIntShape<BYTES>
impl<const BYTES: usize> UnsafeUnpin for BigIntShape<BYTES>
impl<const BYTES: usize> UnwindSafe for BigIntShape<BYTES>
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