Skip to main content

SlotOffset

Struct SlotOffset 

Source
pub struct SlotOffset {
    pub class: SlotClass,
    pub word_offset: u32,
    pub bit_width: u32,
    pub elem_word_count: u32,
    pub row_stride_words: u32,
    pub num_rows: u32,
}
Expand description

Compile-time layout query result STATE hands to CODEGEN (state.md §3: “baked into compiled kernels as LLVM constants”; ledger ST-027, ST-037, ST-129, ST-134, ST-135). Pure Rust (not #[repr(C)]) — this crosses the CODEGEN/STATE boundary as ordinary Rust values at compile time, not as bytes across the compiled-kernel ABI, so it has no FFI-layout obligation. Task 7 adds PartialEq (previously Clone, Copy, Debug only): slot_of (ST-129) is required to return a byte-identical SlotOffset across repeated calls regardless of intervening allocate_instance calls, and the direct field-by-field way to prove that in a test is a structural equality check, not a Debug-string comparison. Every field is itself PartialEq (SlotClass already derives it; the rest are plain integers), so this is a safe, non-lossy derive addition.

Task 10 (ST-027): state.md’s original state-pointer ABI design — CODEGEN inlining a raw compile-time base + word_offset pointer directly, bypassing the accessor calls above — is superseded by ARCHITECTURE §7 item 1’s accessor-ABI (ST-026). This struct’s fields stay pub and readable (CODEGEN needs them to size/typecheck a slot at compile time — width, class, element count), but no function anywhere in vj-sim::state hands a caller a raw *mut/*const pointer it could add one of these fields to itself: the actual address computation (InstanceBase + SlotOffset) happens only inside accessor_impl::slot_location_for/write::commit_write_at, never re-derived by a caller from these fields against a raw base pointer it also holds.

Fields§

§class: SlotClass§word_offset: u32§bit_width: u32§elem_word_count: u32§row_stride_words: u32§num_rows: u32

Trait Implementations§

Source§

impl Clone for SlotOffset

Source§

fn clone(&self) -> Self

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 Copy for SlotOffset

Source§

impl Debug for SlotOffset

Source§

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

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

impl PartialEq for SlotOffset

Source§

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

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

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

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for SlotOffset

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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

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> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

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

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

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

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

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.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V