Trait MaybeAsVarULE
trait MaybeAsVarULE
A trait that associates a VarULE type with a data struct.
Some data structs can be represented compactly as a single VarULE,
such as str or a packed pattern. This trait allows for data providers
to use optimizations for such types.
❗ Not all data structs benefit from this optimization. It works best when the data struct is multiplied across a large number of data marker attributes.
Both MaybeAsVarULE and MaybeEncodeAsVarULE should be implemented
on all data structs. The data_struct! macro provides an impl.
Associated Types
type EncodedStruct: TraitBound { trait_: Path { path: "Sized", id: Id(27), args: None }, generic_params: [], modifier: Maybe } + TraitBound { trait_: Path { path: "VarULE", id: Id(864), args: None }, generic_params: [], modifier: None }The
VarULEtype for this data struct, or[()]if it cannot be represented asVarULE.
Implementors
impl<T, N: usize> MaybeAsVarULE for [T; N]