pub struct StructInfo {
pub name: String,
pub field_count: u16,
}Expand description
one declared struct’s runtime identity: its name and its field count.
the Program::structs table holds one of these per declared struct;
a MAKE_STRUCT opcode’s u16 operand indexes it. the VM reads name to
label the heap struct it builds (so type_of of a struct returns the
declared name) and field_count to know how many values to pop. codegen
fills the table as it emits struct literals.
Fields§
§name: Stringthe struct’s declared name, e.g. "Point". the VM stores this as the
heap struct’s type_name.
field_count: u16the number of fields the struct declares. MAKE_STRUCT pops exactly this many values off the stack to build the struct.
Trait Implementations§
Source§impl Clone for StructInfo
impl Clone for StructInfo
Source§fn clone(&self) -> StructInfo
fn clone(&self) -> StructInfo
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 Debug for StructInfo
impl Debug for StructInfo
Source§impl PartialEq for StructInfo
impl PartialEq for StructInfo
Source§fn eq(&self, other: &StructInfo) -> bool
fn eq(&self, other: &StructInfo) -> bool
Tests for
self and other values to be equal, and is used by ==.impl Eq for StructInfo
impl StructuralPartialEq for StructInfo
Auto Trait Implementations§
impl Freeze for StructInfo
impl RefUnwindSafe for StructInfo
impl Send for StructInfo
impl Sync for StructInfo
impl Unpin for StructInfo
impl UnsafeUnpin for StructInfo
impl UnwindSafe for StructInfo
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