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 Entry
s to the correct type.
This is implemented by the hdk_entry_defs
proc_macro.
Required Associated Types§
type Error
type Error
The error associated with this conversion.
Required Methods§
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>,
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.