Struct kelk_env::context::OwnedContext
source · [−]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: BThe instance of mocked Blockchain
storage: StorageThe instance of mocked Storage
Implementations
sourceimpl<B: Blockchain> OwnedContext<B>
impl<B: Blockchain> OwnedContext<B>
Auto Trait Implementations
impl<B> !RefUnwindSafe for OwnedContext<B>
impl<B> !Send for OwnedContext<B>
impl<B> !Sync for OwnedContext<B>
impl<B> Unpin for OwnedContext<B> where
B: Unpin,
impl<B> !UnwindSafe for OwnedContext<B>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more