[][src]Trait hdk::prelude::AddressableContent

pub trait AddressableContent {
    fn content(&self) -> JsonString;
fn try_from_content(content: &JsonString) -> Result<Self, JsonError>; fn address(&self) -> HashString { ... } }

can be stored as serialized content the content is the address, there is no "location" like a file system or URL @see https://en.wikipedia.org/wiki/Content-addressable_storage

Required methods

fn content(&self) -> JsonString

the Content that would be stored in a ContentAddressableStorage the default implementation covers anything that implements From for JsonString

fn try_from_content(content: &JsonString) -> Result<Self, JsonError>

restore/deserialize the original struct/type from serialized Content the default implementation covers anything that implements From for Foo

Loading content...

Provided methods

fn address(&self) -> HashString

the Address the Content would be available at once stored in a ContentAddressableStorage default implementation is provided as hashing Content with sha256 the default implementation should cover most use-cases it is critical that there are no hash collisions across all stored AddressableContent it is recommended to implement an "address space" prefix for address algorithms that don't offer strong cryptographic guarantees like sha et. al.

Loading content...

Implementations on Foreign Types

impl AddressableContent for Dna[src]

impl AddressableContent for CrudStatus[src]

impl AddressableContent for EntryAspect[src]

impl AddressableContent for ChainHeader[src]

impl AddressableContent for ExampleAddressableContent[src]

impl AddressableContent for ExampleEntry[src]

impl AddressableContent for OtherExampleAddressableContent[src]

address is calculated eagerly rather than on call

impl<A> AddressableContent for EntityAttributeValueIndex<A> where
    A: Attribute + DeserializeOwned
[src]

Loading content...

Implementors

impl AddressableContent for Entry[src]

impl AddressableContent for AgentId[src]

fn address(&self) -> HashString[src]

for an Agent, the address is their public base32 encoded public signing key string

fn content(&self) -> JsonString[src]

get the entry content

impl AddressableContent for JsonString[src]

Loading content...