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>,

source

pub async fn new( vault: AuthorDb, dht_db: DhtDb, dht_db_cache: DhtDbQueryCache, keystore: MetaLairClient, author: AgentPubKey ) -> SourceChainResult<Self>

source

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.

source

pub fn public_only(&mut self)

source

pub fn keystore(&self) -> &MetaLairClient

source

pub fn author_db(&self) -> &AuthorDb

source

pub fn snapshot(&self) -> SourceChainResult<Scratch>

Take a snapshot of the scratch space that will not remain in sync with future updates.

source

pub fn scratch(&self) -> SyncScratch

source

pub fn agent_pubkey(&self) -> &AgentPubKey

source

pub fn to_agent_pubkey(&self) -> Arc<AgentPubKey>

source

pub fn cell_id(&self) -> CellId

source

pub fn scratch_records(&self) -> SourceChainResult<Vec<Record>>

This has to clone all the data because we can’t return references to constructed data.

source

pub async fn zomes_initialized(&self) -> SourceChainResult<bool>

source

pub fn set_zomes_initialized(&self, value: bool)

source

pub fn is_empty(&self) -> SourceChainResult<bool>

source

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.

source

pub fn chain_head(&self) -> SourceChainResult<Option<HeadInfo>>

source

pub fn chain_head_nonempty(&self) -> SourceChainResult<HeadInfo>

source

pub fn len(&self) -> SourceChainResult<u32>

source

pub async fn valid_cap_grant( &self, check_function: GrantedFunction, check_agent: AgentPubKey, check_secret: Option<CapSecret> ) -> SourceChainResult<Option<CapGrant>>

source

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

source

pub async fn is_chain_locked(&self, lock: Vec<u8>) -> SourceChainResult<bool>

source

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>

source§

fn clone(&self) -> SourceChain<AuthorDb, DhtDb>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl From<SourceChain<DbWrite<DbKindAuthored>, DbWrite<DbKindDht>>> for SourceChainRead

source§

fn from(chain: SourceChain) -> Self

Converts to this type from the input type.