Trait hdk::prelude::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_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>

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

Object Safety§

This trait is not object safe.

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>

Implementors§