Enum sp_core::ExecutionContext
source · [−]pub enum ExecutionContext {
Importing,
Syncing,
BlockConstruction,
OffchainCall(Option<(Box<dyn Externalities>, Capabilities)>),
}
Expand description
Context for executing a call into the runtime.
Variants
Importing
Context used for general block import (including locally authored blocks).
Syncing
Context used for importing blocks as part of an initial sync of the blockchain.
We distinguish between major sync and import so that validators who are running their initial sync (or catching up after some time offline) can use the faster native runtime (since we can reasonably assume the network as a whole has already come to a broad conensus on the block and it probably hasn’t been crafted specifically to attack this node), but when importing blocks at the head of the chain in normal operation they can use the safer Wasm version.
BlockConstruction
Context used for block construction.
OffchainCall(Option<(Box<dyn Externalities>, Capabilities)>)
Context used for offchain calls.
This allows passing offchain extension and customizing available capabilities.
Implementations
sourceimpl ExecutionContext
impl ExecutionContext
sourcepub fn capabilities(&self) -> Capabilities
pub fn capabilities(&self) -> Capabilities
Returns the capabilities of particular context.
Auto Trait Implementations
impl !RefUnwindSafe for ExecutionContext
impl Send for ExecutionContext
impl !Sync for ExecutionContext
impl Unpin for ExecutionContext
impl !UnwindSafe for ExecutionContext
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Instruments this type with the provided Span
, returning an
Instrumented
wrapper. Read more
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
sourceimpl<T, Outer> IsWrappedBy<Outer> for T where
Outer: AsRef<T> + AsMut<T> + From<T>,
T: From<Outer>,
impl<T, Outer> IsWrappedBy<Outer> for T where
Outer: AsRef<T> + AsMut<T> + From<T>,
T: From<Outer>,
sourceimpl<S, T> UncheckedInto<T> for S where
T: UncheckedFrom<S>,
impl<S, T> UncheckedInto<T> for S where
T: UncheckedFrom<S>,
sourcefn unchecked_into(self) -> T
fn unchecked_into(self) -> T
The counterpart to unchecked_from
.