Enum sp_core::ExecutionContext[][src]

pub enum ExecutionContext {
    Importing,
    Syncing,
    BlockConstruction,
    OffchainCall(Option<(Box<dyn Externalities>, Capabilities)>),
}

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

impl ExecutionContext[src]

pub fn capabilities(&self) -> Capabilities[src]

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

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T> Instrument for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, Outer> IsWrappedBy<Outer> for T where
    T: From<Outer>,
    Outer: AsRef<T> + AsMut<T> + From<T>, 
[src]

pub fn from_ref(&Outer) -> &T[src]

Get a reference to the inner from the outer.

pub fn from_mut(&mut Outer) -> &mut T[src]

Get a mutable reference to the inner from the outer.

impl<T> Pointable for T[src]

type Init = T

The type for initializers.

impl<T> Same<T> for T[src]

type Output = T

Should always be Self

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

impl<S, T> UncheckedInto<T> for S where
    T: UncheckedFrom<S>, 
[src]

impl<V, T> VZip<V> for T where
    V: MultiLane<T>, 
[src]