#[non_exhaustive]pub enum Kind<Metadata: Default> {
Show 23 variants
Struct {
name: &'static str,
children: Vec<Entry<Metadata>>,
},
Aliased {
name: &'static str,
kind: Box<Descriptor<Metadata>>,
},
Enum {
name: &'static str,
variants: Vec<Variant<Metadata>>,
},
Sequence(Box<Descriptor<Metadata>>),
Option(Box<Descriptor<Metadata>>),
Mapping(Box<Descriptor<Metadata>>, Box<Descriptor<Metadata>>),
DateTime,
String,
U128,
I128,
U64,
I64,
U32,
I32,
U16,
I16,
U8,
I8,
F64,
F32,
Bool,
JSON,
Any,
}Expand description
Enum reflecting all supported types
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Struct
The type is a struct
Fields
Aliased
A struct wrapping a single anonymous field
Fields
kind: Box<Descriptor<Metadata>>The type this alias struct wraps
Enum
A simple no-field enum type
Fields
Sequence(Box<Descriptor<Metadata>>)
A list of items of a consistent type
Option(Box<Descriptor<Metadata>>)
An item which is optionally present
Mapping(Box<Descriptor<Metadata>>, Box<Descriptor<Metadata>>)
A pairwise mapping between consistent types with unique keys
DateTime
A field describing a point in time
String
A string
U128
Unsigned 128 bit integer
I128
Signed 128 bit integer
U64
Unsigned 64 bit integer
I64
Signed 64 bit integer
U32
Unsigned 32 bit integer
I32
Signed 32 bit integer
U16
Unsigned 16 bit integer
I16
Signed 16 bit integer
U8
Unsigned 8 bit integer
I8
Signed 8 bit integer
F64
64 bit floating point number
F32
32 bit floating point number
Bool
A boolean value
JSON
A value of unspecified type, that must be limited to json
Any
A value of unspecified type
Implementations§
Source§impl<Metadata: MetadataKind> Kind<Metadata>
impl<Metadata: MetadataKind> Kind<Metadata>
Sourcepub fn new_struct(
name: &'static str,
children: Vec<Entry<Metadata>>,
flattened_children: &mut [Descriptor<Metadata>],
flattened_metadata: &mut [Metadata],
) -> Self
pub fn new_struct( name: &'static str, children: Vec<Entry<Metadata>>, flattened_children: &mut [Descriptor<Metadata>], flattened_metadata: &mut [Metadata], ) -> Self
Construct a type descriptor for a struct with the given name and fields.
Any structs in the flattened_children list will have their fields added to this new struct as if they were members of it. (this corresponds to the ‘flatten’ parameter in serde)