pub struct Def {
pub name: String,
pub index: i32,
pub kind: DefKind,
pub fields: Vec<Field>,
pub field_value_to_index: HashMap<u32, usize>,
pub field_name_to_index: HashMap<String, usize>,
}Expand description
Represents a single definition in a Schema. Kiwi enums, structs, and messages are all represented using this object.
Fields§
§name: StringThe name of this field from the textual Kiwi schema.
index: i32The index of this Def in the defs field of the parent
Schema. This is used as the type
identifier for any fields with this type.
kind: DefKind§fields: Vec<Field>All fields in this definition. The order matters for struct definitions.
field_value_to_index: HashMap<u32, usize>Maps the value and name members of each Field in
the fields array to its index in that array. This is helpful when
decoding and encoding a field to be able to quickly get to the field
metadata.
field_name_to_index: HashMap<String, usize>Implementations§
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Def
impl RefUnwindSafe for Def
impl Send for Def
impl Sync for Def
impl Unpin for Def
impl UnsafeUnpin for Def
impl UnwindSafe for Def
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