[][src]Trait holochain_entry_utils::HolochainEntry

pub trait HolochainEntry: TryFrom<JsonString> + Into<JsonString> + Clone {
    fn entry_type() -> String;

    fn entry(self) -> Entry { ... }
fn address(&self) -> ZomeApiResult<Address> { ... }
fn from_entry(entry: &Entry) -> Option<Self> { ... } }

Common utility crate that implements default behaviours to make it easy to deal with structs that are stored in holochain entries

Required methods

fn entry_type() -> String

Returns the entry_type for this Entry This entry_type is what is used to identify the Entry in the entry definition

Loading content...

Provided methods

fn entry(self) -> Entry

Wraps the struct into the holochain Entry

fn address(&self) -> ZomeApiResult<Address>

Calculates which address would the Entry have if it was committed

fn from_entry(entry: &Entry) -> Option<Self>

Tries to convert an Entry to the deserialized struct Returns None if the Entry is not of type struct

Loading content...

Implementors

Loading content...