Skip to main content

TableInner

Struct TableInner 

Source
pub struct TableInner {
    pub flags: TableFlags,
    pub lsizenode: u8,
    pub alimit: u32,
    pub array: Box<[LuaValue]>,
    pub node: Box<[TableNode]>,
    pub lastfree: u32,
}
Expand description

Hybrid array + hash storage backing a LuaTable.

All mutating algorithms live as &mut TableInner methods so they can be called from the outer &self API via RefCell::borrow_mut.

Fields§

§flags: TableFlags§lsizenode: u8§alimit: u32§array: Box<[LuaValue]>

Array part. A boxed slice — no capacity field — because it only ever changes size at a resize/rehash boundary, never via incremental push, mirroring C’s raw TValue *array whose length lives in alimit. Growth and shrink rebuild a fresh box in TableInner::resize.

§node: Box<[TableNode]>

Hash part. A boxed slice for the same reason as array: every node vector is built whole in TableInner::set_node_vector and swapped in, mirroring C’s Node *node sized by lsizenode.

§lastfree: u32

Free-slot search cursor for get_free_pos; NO_LASTFREE means the table has no allocated hash part (isdummy in C). Stored as a u32 sentinel rather than Option<usize> to keep the struct compact (W2.3 representation diet); hash parts are capped well below 2^32.

Trait Implementations§

Source§

impl Debug for TableInner

Source§

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

Formats the value using the given formatter. Read more

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