pub trait VirtualStaticExtensionSchema<Discriminant: DiscriminantTag = ()> {
type None: Delimited;
type Some: Delimited;
type Many: Collection<Self::Some>;
type Repr: Delimited + Default + FromTag<Self::None, NoneTag> + TryIntoTag<Self::None, NoneTag> + FromTag<Self::Some, SomeTag> + TryIntoTag<Self::Some, SomeTag> + FromTag<Self::Many, ManyTag> + TryIntoTag<Self::Many, ManyTag>;
}Expand description
Defines the schema for a VirtualStaticExtension identified by a Discriminant.
A VirtualStaticExtensionSchema describes the structure and representation
of an extension field whose type is supplied externally and fully
determined at compile time.
§Context
In the static field model:
VirtualStaticFielddefines fields with fixed structureVirtualStaticExtensionSchemadefines externally supplied types and layoutVirtualStaticExtensionstores values using this schema
This allows containers to support externally defined fields with compile-time determined structure.
§Representation
The Many form is expected to have array-like semantics:
- fixed size
- no dynamic resizing or allocation
- capacity encoded in the type
The schema is purely type-level:
- it does not store data
- it defines how data is represented and interpreted
§Discriminant
The Discriminant links:
- the extension storage
- to its schema
allowing multiple independent extensions to coexist safely.
§Default Discriminant
Discriminant = (): defines a single default extension schema, meaning only one static extension is assumed.
Required Associated Types§
Sourcetype Some: Delimited
type Some: Delimited
The logical element type defined by the schema.
This type is externally supplied.
Sourcetype Many: Collection<Self::Some>
type Many: Collection<Self::Some>
A fixed-size collection of Some with array-like semantics.
Sourcetype Repr: Delimited + Default + FromTag<Self::None, NoneTag> + TryIntoTag<Self::None, NoneTag> + FromTag<Self::Some, SomeTag> + TryIntoTag<Self::Some, SomeTag> + FromTag<Self::Many, ManyTag> + TryIntoTag<Self::Many, ManyTag>
type Repr: Delimited + Default + FromTag<Self::None, NoneTag> + TryIntoTag<Self::None, NoneTag> + FromTag<Self::Some, SomeTag> + TryIntoTag<Self::Some, SomeTag> + FromTag<Self::Many, ManyTag> + TryIntoTag<Self::Many, ManyTag>
Opaque representation of the extension.
Encodes None, Some, or Many and supports tagged conversions.
All conversions are expected to be total (non-fallible), as structure is fully determined at compile time.