pub trait MaybeAsVarULE {
type EncodedStruct: ?Sized + VarULE;
}
Expand description
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.
Required Associated Types§
Sourcetype EncodedStruct: ?Sized + VarULE
type EncodedStruct: ?Sized + VarULE
The [VarULE
] type for this data struct, or [()]
if it cannot be represented as [VarULE
].