pub struct RuntimeRef(/* private fields */);
Implementations§
Source§impl RuntimeRef
impl RuntimeRef
pub fn new( vm_ref: VMConfigRef, executor: Box<dyn Executor + Send + Sync>, ) -> Self
pub fn downgrade(&self) -> RuntimeWeakRef
pub fn get_mut(&mut self) -> &mut Runtime
Sourcepub fn new_cyclic<F>(init_fn: F) -> RuntimeRef
pub fn new_cyclic<F>(init_fn: F) -> RuntimeRef
Helpful for initializing a runtime that contain executors that need to reference back to the runtime itself.
The initializer function receives weak pointer references, because circular strong references ensure a memory leak.
Source§impl RuntimeRef
impl RuntimeRef
Sourcepub fn execute<F>(&self, tx_context: TxContext, call_lambda: F) -> TxContextwhere
F: RuntimeInstanceCallLambda,
pub fn execute<F>(&self, tx_context: TxContext, call_lambda: F) -> TxContextwhere
F: RuntimeInstanceCallLambda,
Executes smart contract call using the given tx context, and the configured executor.
It is possible to customize the specific instance call using the given lambda argument.
Default it is the instance_call
function.
Methods from Deref<Target = Runtime>§
pub fn get_executor_context(&self) -> TxContextRef
Trait Implementations§
Source§impl Clone for RuntimeRef
impl Clone for RuntimeRef
Source§fn clone(&self) -> RuntimeRef
fn clone(&self) -> RuntimeRef
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreAuto Trait Implementations§
impl Freeze for RuntimeRef
impl !RefUnwindSafe for RuntimeRef
impl Send for RuntimeRef
impl Sync for RuntimeRef
impl Unpin for RuntimeRef
impl !UnwindSafe for RuntimeRef
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more