pub trait RibosomeT: Sized + Debug + Send + Sync {
Show 21 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_id: &ZomeId) -> 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_validation_package(
&self,
access: ValidationPackageHostAccess,
invocation: ValidationPackageInvocation
) -> RibosomeResult<ValidationPackageResult>;
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>;
fn zomes_to_invoke(&self, zomes_to_invoke: ZomesToInvoke) -> Vec<Zome>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator,
{ ... }
fn zome_name_to_id(&self, zome_name: &ZomeName) -> RibosomeResult<ZomeId> { ... }
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
fn dna_def(&self) -> &DnaDefHashed
fn zome_info(&self, zome: Zome) -> RibosomeResult<ZomeInfo>
fn get_integrity_zome(&self, zome_id: &ZomeId) -> 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 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.
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_validation_package(
&self,
access: ValidationPackageHostAccess,
invocation: ValidationPackageInvocation
) -> RibosomeResult<ValidationPackageResult>
fn run_post_commit(
&self,
access: PostCommitHostAccess,
invocation: PostCommitInvocation
) -> RibosomeResult<()>
fn run_validate(
&self,
access: ValidateHostAccess,
invocation: ValidateInvocation
) -> RibosomeResult<ValidateResult>
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.
fn call_zome_function(
&self,
access: ZomeCallHostAccess,
invocation: ZomeCallInvocation
) -> RibosomeResult<ZomeCallResponse>
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
fn zome_types(&self) -> &Arc<GlobalZomeTypes>
Provided Methods
fn zomes_to_invoke(&self, zomes_to_invoke: ZomesToInvoke) -> Vec<Zome>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator,
A: Allocator,
fn zome_name_to_id(&self, zome_name: &ZomeName) -> RibosomeResult<ZomeId>
fn list_callbacks(&self)
fn list_callbacks(&self)
@todo list out all the available callbacks and maybe cache them somewhere
fn list_zome_fns(&self)
fn list_zome_fns(&self)
@todo list out all the available zome functions and maybe cache them somewhere
Implementors
impl RibosomeT for RealRibosome
impl RibosomeT for MockRibosomeT
Interface for a Ribosome. Currently used only for mocking, as our only
real concrete type is RealRibosome