Trait holochain_state::query::Store
source · pub trait Store {
// Required methods
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_action(
&self,
hash: &ActionHash
) -> StateQueryResult<Option<SignedActionHashed>>;
fn get_record(&self, hash: &AnyDhtHash) -> StateQueryResult<Option<Record>>;
fn get_public_or_authored_record(
&self,
hash: &AnyDhtHash,
author: Option<&AgentPubKey>
) -> StateQueryResult<Option<Record>>;
fn contains_entry(&self, hash: &EntryHash) -> StateQueryResult<bool>;
fn contains_action(&self, hash: &ActionHash) -> StateQueryResult<bool>;
// Provided method
fn contains_hash(&self, hash: &AnyDhtHash) -> StateQueryResult<bool> { ... }
}
Required Methods§
sourcefn get_entry(&self, hash: &EntryHash) -> StateQueryResult<Option<Entry>>
fn get_entry(&self, hash: &EntryHash) -> StateQueryResult<Option<Entry>>
Get an [Entry
] from this store.
Get an [Entry
] from this store.
- Will return any public entry.
- If an author is provided and an action for this entry matches the author then any entry will be return regardless of visibility .
sourcefn get_action(
&self,
hash: &ActionHash
) -> StateQueryResult<Option<SignedActionHashed>>
fn get_action( &self, hash: &ActionHash ) -> StateQueryResult<Option<SignedActionHashed>>
Get an [SignedActionHashed
] from this store.
sourcefn get_record(&self, hash: &AnyDhtHash) -> StateQueryResult<Option<Record>>
fn get_record(&self, hash: &AnyDhtHash) -> StateQueryResult<Option<Record>>
Get an [Record
] from this store.
Get an [Record
] from this store that is either public or
authored by the given key.
sourcefn contains_entry(&self, hash: &EntryHash) -> StateQueryResult<bool>
fn contains_entry(&self, hash: &EntryHash) -> StateQueryResult<bool>
Check if an entry is contained in the store
sourcefn contains_action(&self, hash: &ActionHash) -> StateQueryResult<bool>
fn contains_action(&self, hash: &ActionHash) -> StateQueryResult<bool>
Check if an action is contained in the store
Provided Methods§
sourcefn contains_hash(&self, hash: &AnyDhtHash) -> StateQueryResult<bool>
fn contains_hash(&self, hash: &AnyDhtHash) -> StateQueryResult<bool>
Check if a hash is contained in the store