Skip to main content

GroundedCoord

Struct GroundedCoord 

Source
pub struct GroundedCoord { /* private fields */ }
Expand description

A single grounded coordinate value. Not a Datum [this is the narrow intermediate that a Grounding impl produces]. The foundation validates and mints it into a Datum. Uses the same closed level-tagged family as Datum, ensuring that coordinate width matches the target Witt level.

§Examples

use uor_foundation::enforcement::GroundedCoord;

// W8: 8-bit ring Z/256Z — lightweight, exhaustive-verification baseline
let byte_coord = GroundedCoord::w8(42);

// W16: 16-bit ring Z/65536Z — audio samples, small indices
let short_coord = GroundedCoord::w16(1000);

// W32: 32-bit ring Z/2^32Z — pixel data, general-purpose integers
let word_coord = GroundedCoord::w32(70_000);

Implementations§

Source§

impl GroundedCoord

Source

pub const fn w8(value: u8) -> GroundedCoord

Construct a W8 coordinate from a u8 value (little-endian).

Source

pub const fn w16(value: u16) -> GroundedCoord

Construct a W16 coordinate from a u16 value (little-endian).

Source

pub const fn w24(value: u32) -> GroundedCoord

Construct a W24 coordinate from a u32 value (little-endian).

Source

pub const fn w32(value: u32) -> GroundedCoord

Construct a W32 coordinate from a u32 value (little-endian).

Source

pub const fn w40(value: u64) -> GroundedCoord

Construct a W40 coordinate from a u64 value (little-endian).

Source

pub const fn w48(value: u64) -> GroundedCoord

Construct a W48 coordinate from a u64 value (little-endian).

Source

pub const fn w56(value: u64) -> GroundedCoord

Construct a W56 coordinate from a u64 value (little-endian).

Source

pub const fn w64(value: u64) -> GroundedCoord

Construct a W64 coordinate from a u64 value (little-endian).

Source

pub const fn w72(value: u128) -> GroundedCoord

Construct a W72 coordinate from a u128 value (little-endian).

Source

pub const fn w80(value: u128) -> GroundedCoord

Construct a W80 coordinate from a u128 value (little-endian).

Source

pub const fn w88(value: u128) -> GroundedCoord

Construct a W88 coordinate from a u128 value (little-endian).

Source

pub const fn w96(value: u128) -> GroundedCoord

Construct a W96 coordinate from a u128 value (little-endian).

Source

pub const fn w104(value: u128) -> GroundedCoord

Construct a W104 coordinate from a u128 value (little-endian).

Source

pub const fn w112(value: u128) -> GroundedCoord

Construct a W112 coordinate from a u128 value (little-endian).

Source

pub const fn w120(value: u128) -> GroundedCoord

Construct a W120 coordinate from a u128 value (little-endian).

Source

pub const fn w128(value: u128) -> GroundedCoord

Construct a W128 coordinate from a u128 value (little-endian).

Trait Implementations§

Source§

impl Clone for GroundedCoord

Source§

fn clone(&self) -> GroundedCoord

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for GroundedCoord

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
Source§

impl<Map> GroundingProgramRun<GroundedCoord> for GroundingProgram<GroundedCoord, Map>
where Map: GroundingMapKind,

Source§

fn run_program(&self, external: &[u8]) -> Option<GroundedCoord>

Run the program on external bytes.
Source§

impl PartialEq for GroundedCoord

Source§

fn eq(&self, other: &GroundedCoord) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Eq for GroundedCoord

Source§

impl GroundedValue for GroundedCoord

Source§

impl StructuralPartialEq for GroundedCoord

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.