pub trait RibosomeT: Sized + Debug {
Show 16 methods
fn dna_def(&self) -> &DnaDefHashed;
fn zome_info(&self, zome: Zome) -> RibosomeResult<ZomeInfo>;
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 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 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_to_id(&self, zome: &Zome) -> 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 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 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. Just calls
[run_callback
][] under the hood.
[run_callback
]: #method.run_callback
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
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_to_id(&self, zome: &Zome) -> 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]