pub trait RibosomeT: Sized + Debug + Send + Sync {
Show 20 methods // Required methods fn dna_def(&self) -> &DnaDefHashed; fn dna_hash(&self) -> &DnaHash; fn dna_file(&self) -> &DnaFile; fn zome_info(&self, zome: Zome) -> RibosomeResult<ZomeInfo>; fn get_integrity_zome( &self, zome_index: &ZomeIndex ) -> Option<IntegrityZome>; fn call_iterator<I: Invocation + 'static>( &self, host_context: HostContext, invocation: I ) -> CallIterator<Self, I>; fn maybe_call<I: Invocation + 'static>( &self, host_context: HostContext, invocation: &I, zome: &Zome, to_call: &FunctionName ) -> Result<Option<ExternIO>, RibosomeError>; fn get_const_fn( &self, zome: &Zome, name: &str ) -> Result<Option<i32>, RibosomeError>; fn run_genesis_self_check( &self, access: GenesisSelfCheckHostAccess, invocation: GenesisSelfCheckInvocation ) -> RibosomeResult<GenesisSelfCheckResult>; fn run_init( &self, access: InitHostAccess, invocation: InitInvocation ) -> RibosomeResult<InitResult>; fn run_migrate_agent( &self, access: MigrateAgentHostAccess, invocation: MigrateAgentInvocation ) -> RibosomeResult<MigrateAgentResult>; fn run_entry_defs( &self, access: EntryDefsHostAccess, invocation: EntryDefsInvocation ) -> RibosomeResult<EntryDefsResult>; fn run_post_commit( &self, access: PostCommitHostAccess, invocation: PostCommitInvocation ) -> RibosomeResult<()>; fn run_validate( &self, access: ValidateHostAccess, invocation: ValidateInvocation ) -> RibosomeResult<ValidateResult>; fn call_zome_function( &self, access: ZomeCallHostAccess, invocation: ZomeCallInvocation ) -> RibosomeResult<ZomeCallResponse>; fn zome_types(&self) -> &Arc<GlobalZomeTypes>; // Provided methods fn zomes_to_invoke(&self, zomes_to_invoke: ZomesToInvoke) -> Vec<Zome> { ... } fn zome_name_to_id(&self, zome_name: &ZomeName) -> RibosomeResult<ZomeIndex> { ... } fn list_callbacks(&self) { ... } fn list_zome_fns(&self) { ... }
}
Expand description

Interface for a Ribosome. Currently used only for mocking, as our only real concrete type is RealRibosome

Required Methods§

source

fn dna_def(&self) -> &DnaDefHashed

source

fn dna_hash(&self) -> &DnaHash

source

fn dna_file(&self) -> &DnaFile

source

fn zome_info(&self, zome: Zome) -> RibosomeResult<ZomeInfo>

source

fn get_integrity_zome(&self, zome_index: &ZomeIndex) -> Option<IntegrityZome>

source

fn call_iterator<I: Invocation + 'static>( &self, host_context: HostContext, invocation: I ) -> CallIterator<Self, I>

source

fn maybe_call<I: Invocation + 'static>( &self, host_context: HostContext, invocation: &I, zome: &Zome, to_call: &FunctionName ) -> Result<Option<ExternIO>, RibosomeError>

source

fn get_const_fn( &self, zome: &Zome, name: &str ) -> Result<Option<i32>, RibosomeError>

Get a value from a const wasm function.

This is really a stand in until Rust can properly support const wasm values.

This allows getting values from wasm without the need for any translation. The same technique can be used with the wasmer cli to validate these values without needing to make holochain a dependency.

source

fn run_genesis_self_check( &self, access: GenesisSelfCheckHostAccess, invocation: GenesisSelfCheckInvocation ) -> RibosomeResult<GenesisSelfCheckResult>

source

fn run_init( &self, access: InitHostAccess, invocation: InitInvocation ) -> RibosomeResult<InitResult>

source

fn run_migrate_agent( &self, access: MigrateAgentHostAccess, invocation: MigrateAgentInvocation ) -> RibosomeResult<MigrateAgentResult>

source

fn run_entry_defs( &self, access: EntryDefsHostAccess, invocation: EntryDefsInvocation ) -> RibosomeResult<EntryDefsResult>

source

fn run_post_commit( &self, access: PostCommitHostAccess, invocation: PostCommitInvocation ) -> RibosomeResult<()>

source

fn run_validate( &self, access: ValidateHostAccess, invocation: ValidateInvocation ) -> RibosomeResult<ValidateResult>

Helper function for running a validation callback. Calls private fn do_callback! under the hood.

source

fn call_zome_function( &self, access: ZomeCallHostAccess, invocation: ZomeCallInvocation ) -> RibosomeResult<ZomeCallResponse>

Runs the specified zome fn. Returns the cursor used by HDK, so that it can be passed on to source chain manager for transactional writes

source

fn zome_types(&self) -> &Arc<GlobalZomeTypes>

Provided Methods§

source

fn zomes_to_invoke(&self, zomes_to_invoke: ZomesToInvoke) -> Vec<Zome>

source

fn zome_name_to_id(&self, zome_name: &ZomeName) -> RibosomeResult<ZomeIndex>

source

fn list_callbacks(&self)

@todo list out all the available callbacks and maybe cache them somewhere

source

fn list_zome_fns(&self)

@todo list out all the available zome functions and maybe cache them somewhere

Implementors§

source§

impl RibosomeT for RealRibosome

source§

impl RibosomeT for MockRibosomeT

Interface for a Ribosome. Currently used only for mocking, as our only real concrete type is RealRibosome