Skip to main content

ToEncoded

Trait ToEncoded 

Source
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:

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§

Source

fn to_encoded(self) -> Encoded<V>

Produce the Encoded the macro absorbs.

Implementors§

Source§

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.

Source§

impl<V: InlineEncoding> ToEncoded<V> for Inline<V>