pub struct MockRibosomeT { /* private fields */ }
Expand description

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

Implementations§

source§

impl MockRibosomeT

source

pub fn checkpoint(&mut self)

Validate that all current expectations for all methods have been satisfied, and discard them.

source

pub fn new() -> Self

Create a new mock object with no expectations.

This method will not be generated if the real struct already has a new method. However, it will be generated if the struct implements a trait with a new method. The trait’s new method can still be called like <MockX as TraitY>::new

source§

impl MockRibosomeT

source

pub fn expect_dna_def(&mut self) -> &mut Expectation

Create an Expectation for mocking the dna_def method

source

pub fn expect_dna_hash(&mut self) -> &mut Expectation

Create an Expectation for mocking the dna_hash method

source

pub fn expect_dna_file(&mut self) -> &mut Expectation

Create an Expectation for mocking the dna_file method

source

pub fn expect_zome_info(&mut self) -> &mut Expectation

Create an Expectation for mocking the zome_info method

source

pub fn expect_zomes_to_invoke(&mut self) -> &mut Expectation

Create an Expectation for mocking the zomes_to_invoke method

source

pub fn expect_zome_name_to_id(&mut self) -> &mut Expectation

Create an Expectation for mocking the zome_name_to_id method

source

pub fn expect_get_integrity_zome(&mut self) -> &mut Expectation

Create an Expectation for mocking the get_integrity_zome method

source

pub fn expect_call_iterator<I: Invocation + 'static>( &mut self ) -> &mut Expectation<I>

Create an Expectation for mocking the call_iterator method

source

pub fn expect_maybe_call<I: Invocation + 'static>( &mut self ) -> &mut Expectation<I>

Create an Expectation for mocking the maybe_call method

source

pub fn expect_get_const_fn(&mut self) -> &mut Expectation

Create an Expectation for mocking the get_const_fn method

source

pub fn expect_list_callbacks(&mut self) -> &mut Expectation

Create an Expectation for mocking the list_callbacks method

source

pub fn expect_list_zome_fns(&mut self) -> &mut Expectation

Create an Expectation for mocking the list_zome_fns method

source

pub fn expect_run_genesis_self_check(&mut self) -> &mut Expectation

Create an Expectation for mocking the run_genesis_self_check method

source

pub fn expect_run_init(&mut self) -> &mut Expectation

Create an Expectation for mocking the run_init method

source

pub fn expect_run_migrate_agent(&mut self) -> &mut Expectation

Create an Expectation for mocking the run_migrate_agent method

source

pub fn expect_run_entry_defs(&mut self) -> &mut Expectation

Create an Expectation for mocking the run_entry_defs method

source

pub fn expect_run_post_commit(&mut self) -> &mut Expectation

Create an Expectation for mocking the run_post_commit method

source

pub fn expect_run_validate(&mut self) -> &mut Expectation

Create an Expectation for mocking the run_validate method

source

pub fn expect_call_zome_function(&mut self) -> &mut Expectation

Create an Expectation for mocking the call_zome_function method

source

pub fn expect_zome_types(&mut self) -> &mut Expectation

Create an Expectation for mocking the zome_types method

Trait Implementations§

source§

impl Debug for MockRibosomeT

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
source§

impl Default for MockRibosomeT

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl RibosomeT for MockRibosomeT

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

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

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 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 zomes_to_invoke(&self, zomes_to_invoke: ZomesToInvoke) -> Vec<Zome>

source§

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

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<MockRibosomeT, 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 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 zome_types(&self) -> &Arc<GlobalZomeTypes>

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Any for T
where T: Any,

§

fn into_any(self: Box<T>) -> Box<dyn Any>

§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

§

fn type_name(&self) -> &'static str

§

impl<T> AnySync for T
where T: Any + Send + Sync,

§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Send + Sync>

§

impl<T> ArchivePointee for T

§

type ArchivedMetadata = ()

The archived version of the pointer metadata for this type.
§

fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata ) -> <T as Pointee>::Metadata

Converts some archived metadata to the pointer metadata for itself.
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<F, W, T, D> Deserialize<With<T, W>, D> for F
where W: DeserializeWith<F, T, D>, D: Fallible + ?Sized, F: ?Sized,

§

fn deserialize( &self, deserializer: &mut D ) -> Result<With<T, W>, <D as Fallible>::Error>

Deserializes using the given deserializer
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> FutureExt for T

§

fn with_context(self, otel_cx: Context) -> WithContext<Self>

Attaches the provided Context to this type, returning a WithContext wrapper. Read more
§

fn with_current_context(self) -> WithContext<Self>

Attaches the current Context to this type, returning a WithContext wrapper. Read more
source§

impl<T> Instrument for T

source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T> Instrument for T

source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<T> Pointee for T

§

type Metadata = ()

The type for metadata in pointers and references to Self.
source§

impl<T> Same for T

§

type Output = T

Should always be Self
§

impl<SS, SP> SupersetOf<SS> for SP
where SS: SubsetOf<SP>,

§

fn to_subset(&self) -> Option<SS>

The inverse inclusion map: attempts to construct self from the equivalent element of its superset. Read more
§

fn is_in_subset(&self) -> bool

Checks if self is actually part of its subset T (and can be converted to it).
§

fn to_subset_unchecked(&self) -> SS

Use with care! Same as self.to_subset but without any property checks. Always succeeds.
§

fn from_subset(element: &SS) -> SP

The inclusion map: converts self to the equivalent element of its superset.
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<T> Upcastable for T
where T: Any + Send + Sync + 'static,

§

fn upcast_any_ref(&self) -> &(dyn Any + 'static)

upcast ref
§

fn upcast_any_mut(&mut self) -> &mut (dyn Any + 'static)

upcast mut ref
§

fn upcast_any_box(self: Box<T>) -> Box<dyn Any>

upcast boxed dyn
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

source§

impl<T> WithSubscriber for T

source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

impl<T> WithSubscriber for T

source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more