pub trait ToEncoded<V: InlineEncoding> {
// Required method
fn to_encoded(self) -> Encoded<V>;
}Expand description
Lift an IntoEncoded::Output into the Encoded sum the
entity!{} macro folds into a Fragment.
V is the attribute’s inline encoding. Two impls cover everything:
Inline<V>delegates toInlineEncoding::to_encoded— inline path, yieldsEncoded::Inline(form).Blob<T>targetingHandle<T>delegates toBlobEncoding::to_encoded— handle path, yieldsEncoded::Blob(form.transmute()).
This trait is the dispatch shim for the macro layer; the
actual logic lives on the schema traits so users (and overriding
schemas) can call it directly without going through the trait.
to_encoded matches the to_inline/to_blob style of the
supertrait aliases.
Required Methods§
Sourcefn to_encoded(self) -> Encoded<V>
fn to_encoded(self) -> Encoded<V>
Produce the Encoded the macro absorbs.
Implementors§
impl<T> ToEncoded<Handle<T>> for Blob<T>
Blob<T> is the ToEncoded<Handle<T>> expander: it delegates to
BlobEncoding::to_encoded for the actual blob-to-Encoded lift. The
trait is the macro-side dispatch shim; the logic lives on
BlobEncoding so users (and schemas that need custom storage
semantics) can call or override it directly.