Skip to main content

TableDesc

Struct TableDesc 

Source
pub struct TableDesc {
Show 15 fields pub key: Key64, pub name: &'static str, pub schema_hash: u64, pub storage: Storage, pub flags: u16, pub realization_priority: u8, pub defaults: &'static [u32], pub word_effects: &'static [u8], pub str_words: u32, pub resource_words: u32, pub events_word: u8, pub events: Option<&'static ValueSetDesc>, pub inherited: bool, pub fields: &'static [FieldDesc], pub resource_kinds: &'static [(u8, Key64)],
}
Expand description

Compile-time description of a table, emitted by #[derive(NvTable)].

Fields§

§key: Key64§name: &'static str§schema_hash: u64

xxh64 over the canonical field layout; a mismatch across a boundary is a hard error.

§storage: Storage§flags: u16§realization_priority: u8

Declarative realization priority (0 = non-realizing / modifier table; 1..=255 = realizing component priority where higher wins and ties break deterministically by TableKey).

§defaults: &'static [u32]§word_effects: &'static [u8]

Effect class per word (len == defaults.len()).

§str_words: u32

Bit i set: word i is the offset word of a two-word string reference.

§resource_words: u32

Bit i set: word i holds a ResourceId.

§events_word: u8

Word holding the EventSet subscription mask (NO_VAL_WORD if none).

§events: Option<&'static ValueSetDesc>

Listener bits of that EventSet<E> (EventEnum::EVENT_SET: <E>Set, one (variant, 1 << id) flag per event), mirrored to hosts; None without events.

§inherited: bool

True when word 0 is the hidden __explicit: u32 bitmask for #[nv_table(inherited)].

§fields: &'static [FieldDesc]§resource_kinds: &'static [(u8, Key64)]

(word_index, FlatResource::KIND) pairs for every Res<R> field in this table.

Implementations§

Source§

impl TableDesc

Source

pub const fn words(&self) -> usize

Source

pub const fn resource_kind(&self, word: usize) -> Option<Key64>

Returns the expected FlatResource::KIND for resource word, if declared on this table.

Source

pub const fn effects(&self) -> u8

Union of all word effects.

Trait Implementations§

Source§

impl Clone for TableDesc

Source§

fn clone(&self) -> TableDesc

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 TableDesc

Source§

impl Debug for TableDesc

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl Forget for TableDesc

§

impl Freeze for TableDesc
where &'static str: Freeze, &'static [u32]: Freeze, &'static [u8]: Freeze, &'static ValueSetDesc: Freeze, &'static [FieldDesc]: Freeze, &'static [(u8, Key64)]: Freeze,

§

impl Move for TableDesc

§

impl RefUnwindSafe for TableDesc

§

impl Send for TableDesc
where &'static str: Send, &'static [u32]: Send, &'static [u8]: Send, &'static ValueSetDesc: Send, &'static [FieldDesc]: Send, &'static [(u8, Key64)]: Send,

§

impl Sync for TableDesc

§

impl Unpin for TableDesc
where &'static str: Unpin, &'static [u32]: Unpin, &'static [u8]: Unpin, &'static ValueSetDesc: Unpin, &'static [FieldDesc]: Unpin, &'static [(u8, Key64)]: Unpin,

§

impl UnsafeUnpin for TableDesc
where &'static str: UnsafeUnpin, &'static [u32]: UnsafeUnpin, &'static [u8]: UnsafeUnpin, &'static ValueSetDesc: UnsafeUnpin, &'static [FieldDesc]: UnsafeUnpin, &'static [(u8, Key64)]: UnsafeUnpin,

§

impl UnwindSafe for TableDesc
where &'static str: UnwindSafe, &'static [u32]: UnwindSafe, &'static [u8]: UnwindSafe, &'static ValueSetDesc: UnwindSafe, &'static [FieldDesc]: UnwindSafe, &'static [(u8, Key64)]: UnwindSafe,

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