[][src]Trait holochain_persistence_api::cas::content::AddressableContent

pub trait AddressableContent {
    fn content(&self) -> Content;
fn try_from_content(content: &Content) -> Result<Self, JsonError>
    where
        Self: Sized
; fn address(&self) -> Address { ... } }

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) -> Content

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

fn try_from_content(content: &Content) -> Result<Self, JsonError> where
    Self: Sized

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) -> Address

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...

Implementors

impl AddressableContent for ExampleAddressableContent[src]

impl AddressableContent for OtherExampleAddressableContent[src]

address is calculated eagerly rather than on call

impl AddressableContent for ExampleEntry[src]

impl AddressableContent for Content[src]

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

Loading content...