pub enum Def {
Scalar(ScalarDef),
Struct(StructDef),
TupleStruct(StructDef),
Tuple(StructDef),
Map(MapDef),
List(ListDef),
Enum(EnumDef),
}Expand description
The definition of a shape: is it more like a struct, a map, a list?
Variants§
Scalar(ScalarDef)
Scalar — those don’t have a def, they’re not composed of other things.
You can interact with them through ValueVTable.
e.g. u32, String, bool, SocketAddr, etc.
Struct(StructDef)
Struct with statically-known, named fields
e.g. struct Struct { field: u32 }
TupleStruct(StructDef)
Tuple-struct, with numbered fields
e.g. struct TupleStruct(u32, u32);
Tuple(StructDef)
Tuple, with numbered fields
e.g. (u32, u32);
Map(MapDef)
Map — keys are dynamic (and strings, sorry), values are homogeneous
e.g. Map<String, T>
List(ListDef)
Ordered list of heterogenous values, variable size
e.g. Vec<T>
Enum(EnumDef)
Enum with variants
e.g. enum Enum { Variant1, Variant2 }
Trait Implementations§
impl Copy for Def
impl Eq for Def
impl StructuralPartialEq for Def
Auto Trait Implementations§
impl Freeze for Def
impl RefUnwindSafe for Def
impl Send for Def
impl Sync for Def
impl Unpin 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