Trait holochain_state::query::Store
source · [−]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
Get an Entry
from this store.
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 .
fn get_header(
&self,
hash: &HeaderHash
) -> StateQueryResult<Option<SignedHeaderHashed>>
fn get_header(
&self,
hash: &HeaderHash
) -> StateQueryResult<Option<SignedHeaderHashed>>
Get an SignedHeaderHashed
from this store.
fn get_element(&self, hash: &AnyDhtHash) -> StateQueryResult<Option<Element>>
fn get_element(&self, hash: &AnyDhtHash) -> StateQueryResult<Option<Element>>
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>
fn contains_entry(&self, hash: &EntryHash) -> StateQueryResult<bool>
Check if an entry is contained in the store
fn contains_header(&self, hash: &HeaderHash) -> StateQueryResult<bool>
fn contains_header(&self, hash: &HeaderHash) -> StateQueryResult<bool>
Check if a header is contained in the store
Provided methods
fn contains_hash(&self, hash: &AnyDhtHash) -> StateQueryResult<bool>
fn contains_hash(&self, hash: &AnyDhtHash) -> StateQueryResult<bool>
Check if a hash is contained in the store