Skip to main content

EntryTypesHelper

Trait EntryTypesHelper 

Source
pub trait EntryTypesHelper: Sized {
    type Error;

    // Required method
    fn deserialize_from_type<Z, I>(
        zome_index: Z,
        entry_def_index: I,
        entry: &Entry,
    ) -> Result<Option<Self>, Self::Error>
       where Z: Into<ZomeIndex>,
             I: Into<EntryDefIndex>;
}
Expand description

Helper trait for deserializing Entrys to the correct type.

This is implemented by the hdk_entry_types proc_macro.

Required Associated Types§

Source

type Error

The error associated with this conversion.

Required Methods§

Source

fn deserialize_from_type<Z, I>( zome_index: Z, entry_def_index: I, entry: &Entry, ) -> Result<Option<Self>, Self::Error>

Check if the ZomeIndex and EntryDefIndex matches one of the ZomeEntryTypesKey::from(Self::variant) and if it does deserialize the Entry into that type.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl EntryTypesHelper for ()

Source§

type Error = Infallible

Source§

fn deserialize_from_type<Z, I>( _zome_index: Z, _entry_def_index: I, _entry: &Entry, ) -> Result<Option<()>, <() as EntryTypesHelper>::Error>

Implementors§