pub struct OwnedContext<B: Blockchain> {
    pub blockchain: B,
    pub storage: Storage,
}
Expand description

OwnedContext owns the ContextAPI instance. It allow dependency injection at runtime. This cannot be copied or cloned since api doesn’t implement Copy and Clone traits. It can be easily mocked for the testing environment.

Fields

blockchain: B

The instance of mocked Blockchain

storage: Storage

The instance of mocked Storage

Implementations

returns the context as reference

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

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

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.