[−][src]Trait hdk::prelude::AddressableContent
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
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
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.
Implementations on Foreign Types
impl AddressableContent for ChainHeader
[src]
fn content(&self) -> JsonString
[src]
fn try_from_content(content: &JsonString) -> Result<ChainHeader, JsonError>
[src]
impl AddressableContent for EntryAspect
[src]
fn content(&self) -> JsonString
[src]
fn try_from_content(content: &JsonString) -> Result<EntryAspect, JsonError>
[src]
impl AddressableContent for CrudStatus
[src]
fn content(&self) -> JsonString
[src]
fn try_from_content(content: &JsonString) -> Result<CrudStatus, JsonError>
[src]
impl AddressableContent for Dna
[src]
fn content(&self) -> JsonString
[src]
fn try_from_content(content: &JsonString) -> Result<Dna, JsonError>
[src]
impl AddressableContent for ExampleAddressableContent
[src]
fn content(&self) -> JsonString
[src]
fn try_from_content(
content: &JsonString
) -> Result<ExampleAddressableContent, JsonError>
[src]
content: &JsonString
) -> Result<ExampleAddressableContent, JsonError>
impl AddressableContent for OtherExampleAddressableContent
[src]
address is calculated eagerly rather than on call
fn address(&self) -> HashString
[src]
fn content(&self) -> JsonString
[src]
fn try_from_content(
content: &JsonString
) -> Result<OtherExampleAddressableContent, JsonError>
[src]
content: &JsonString
) -> Result<OtherExampleAddressableContent, JsonError>
impl AddressableContent for ExampleEntry
[src]
fn address(&self) -> HashString
[src]
fn content(&self) -> JsonString
[src]
fn try_from_content(content: &JsonString) -> Result<ExampleEntry, JsonError>
[src]
impl<A> AddressableContent for EntityAttributeValueIndex<A> where
A: Attribute + DeserializeOwned,
[src]
A: Attribute + DeserializeOwned,
fn content(&self) -> JsonString
[src]
fn try_from_content(
content: &JsonString
) -> Result<EntityAttributeValueIndex<A>, JsonError>
[src]
content: &JsonString
) -> Result<EntityAttributeValueIndex<A>, JsonError>
Implementors
impl AddressableContent for Entry
[src]
fn address(&self) -> HashString
[src]
fn content(&self) -> JsonString
[src]
fn try_from_content(content: &JsonString) -> Result<Entry, JsonError>
[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