pub trait EntryTypesHelper: Sized {
    type Error;

    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_defs 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>where
    Z: Into<ZomeIndex>,
    I: Into<EntryDefIndex>,

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

Implementations on Foreign Types§

source§

impl EntryTypesHelper for ()

§

type Error = Infallible

source§

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

Implementors§