pub trait Store {
    fn get_entry(&self, hash: &EntryHash) -> StateQueryResult<Option<Entry>>;
fn get_public_or_authored_entry(
        &self,
        hash: &EntryHash,
        author: Option<&AgentPubKey>
    ) -> StateQueryResult<Option<Entry>>;
fn get_header(
        &self,
        hash: &HeaderHash
    ) -> StateQueryResult<Option<SignedHeaderHashed>>;
fn get_element(
        &self,
        hash: &AnyDhtHash
    ) -> StateQueryResult<Option<Element>>;
fn get_public_or_authored_element(
        &self,
        hash: &AnyDhtHash,
        author: Option<&AgentPubKey>
    ) -> StateQueryResult<Option<Element>>;
fn contains_entry(&self, hash: &EntryHash) -> StateQueryResult<bool>;
fn contains_header(&self, hash: &HeaderHash) -> StateQueryResult<bool>; fn contains_hash(&self, hash: &AnyDhtHash) -> StateQueryResult<bool> { ... } }

Required methods

fn get_entry(&self, hash: &EntryHash) -> StateQueryResult<Option<Entry>>

Get an Entry from this store.

fn get_public_or_authored_entry(
    &self,
    hash: &EntryHash,
    author: Option<&AgentPubKey>
) -> StateQueryResult<Option<Entry>>

Get an Entry from this store.

  • Will return any public entry.
  • If an author is provided and a header for this entry matches the author then any entry will be return regardless of visibility .

Get an SignedHeaderHashed from this store.

Get an Element from this store.

Get an Element from this store that is either public or authored by the given key.

fn contains_entry(&self, hash: &EntryHash) -> StateQueryResult<bool>

Check if an entry is contained in the store

Check if a header is contained in the store

Provided methods

Check if a hash is contained in the store

Implementors