Type Alias holochain_state::source_chain::SourceChainRead
source · pub type SourceChainRead = SourceChain<DbRead<DbKindAuthored>, DbRead<DbKindDht>>;
Expand description
A source chain with read only access to the underlying databases.
Aliased Type§
struct SourceChainRead { /* private fields */ }
Implementations§
source§impl<AuthorDb, DhtDb> SourceChain<AuthorDb, DhtDb>where
AuthorDb: ReadAccess<DbKindAuthored>,
DhtDb: ReadAccess<DbKindDht>,
impl<AuthorDb, DhtDb> SourceChain<AuthorDb, DhtDb>where AuthorDb: ReadAccess<DbKindAuthored>, DhtDb: ReadAccess<DbKindDht>,
pub async fn new( vault: AuthorDb, dht_db: DhtDb, dht_db_cache: DhtDbQueryCache, keystore: MetaLairClient, author: AgentPubKey ) -> SourceChainResult<Self>
sourcepub async fn raw_empty(
vault: AuthorDb,
dht_db: DhtDb,
dht_db_cache: DhtDbQueryCache,
keystore: MetaLairClient,
author: AgentPubKey
) -> SourceChainResult<Self>
pub async fn raw_empty( vault: AuthorDb, dht_db: DhtDb, dht_db_cache: DhtDbQueryCache, keystore: MetaLairClient, author: AgentPubKey ) -> SourceChainResult<Self>
Create a source chain with a blank chain head. You probably don’t want this. This type is only useful for when a source chain really needs to be constructed before genesis runs.
pub fn public_only(&mut self)
pub fn keystore(&self) -> &MetaLairClient
sourcepub fn snapshot(&self) -> SourceChainResult<Scratch>
pub fn snapshot(&self) -> SourceChainResult<Scratch>
Take a snapshot of the scratch space that will not remain in sync with future updates.
pub fn scratch(&self) -> SyncScratch
pub fn agent_pubkey(&self) -> &AgentPubKey
pub fn to_agent_pubkey(&self) -> Arc<AgentPubKey>
pub fn cell_id(&self) -> CellId
sourcepub fn scratch_records(&self) -> SourceChainResult<Vec<Record>>
pub fn scratch_records(&self) -> SourceChainResult<Vec<Record>>
This has to clone all the data because we can’t return references to constructed data.
pub async fn zomes_initialized(&self) -> SourceChainResult<bool>
pub fn set_zomes_initialized(&self, value: bool)
pub fn is_empty(&self) -> SourceChainResult<bool>
sourcepub fn persisted_head_info(&self) -> Option<HeadInfo>
pub fn persisted_head_info(&self) -> Option<HeadInfo>
Accessor for the chain head that will be used at flush time to check the “as at” for ordering integrity etc.
pub fn chain_head(&self) -> SourceChainResult<Option<HeadInfo>>
pub fn chain_head_nonempty(&self) -> SourceChainResult<HeadInfo>
pub fn len(&self) -> SourceChainResult<u32>
pub async fn valid_cap_grant( &self, check_function: GrantedFunction, check_agent: AgentPubKey, check_secret: Option<CapSecret> ) -> SourceChainResult<Option<CapGrant>>
sourcepub async fn query(&self, query: QueryFilter) -> SourceChainResult<Vec<Record>>
pub async fn query(&self, query: QueryFilter) -> SourceChainResult<Vec<Record>>
Query Actions in the source chain.
This returns a Vec rather than an iterator because it is intended to be
used by the query
host function, which crosses the wasm boundary
pub async fn is_chain_locked(&self, lock: Vec<u8>) -> SourceChainResult<bool>
sourcepub fn countersigning_op(&self) -> SourceChainResult<Option<DhtOp>>
pub fn countersigning_op(&self) -> SourceChainResult<Option<DhtOp>>
If there is a countersigning session get the StoreEntry op to send to the entry authorities.
Trait Implementations§
source§impl<AuthorDb: Clone, DhtDb: Clone> Clone for SourceChain<AuthorDb, DhtDb>
impl<AuthorDb: Clone, DhtDb: Clone> Clone for SourceChain<AuthorDb, DhtDb>
source§fn clone(&self) -> SourceChain<AuthorDb, DhtDb>
fn clone(&self) -> SourceChain<AuthorDb, DhtDb>
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more