[][src]Struct casper_node::reactor::Runner

pub struct Runner<R> where
    R: Reactor
{ /* fields omitted */ }

A runner for a reactor.

The runner manages a reactors event queue and reactor itself and can run it either continuously or in a step-by-step manner.

Implementations

impl<R> Runner<R> where
    R: Reactor,
    R::Error: From<Error>, 
[src]

pub async fn new<'_>(
    cfg: R::Config,
    rng: &'_ mut dyn CryptoRngCore
) -> Result<Self, R::Error>
[src]

Creates a new runner from a given configuration.

Creates a metrics registry that is only going to be used in this runner.

pub async fn with_metrics<'_, '_>(
    cfg: R::Config,
    rng: &'_ mut dyn CryptoRngCore,
    registry: &'_ Registry
) -> Result<Self, R::Error>
[src]

Creates a new runner from a given configuration, using existing metrics.

pub async fn crank<'_, '_>(&'_ mut self, rng: &'_ mut dyn CryptoRngCore)[src]

Processes a single event on the event queue.

pub async fn try_crank<'_, '_>(
    &'_ mut self,
    rng: &'_ mut dyn CryptoRngCore
) -> Option<()>
[src]

Processes a single event if there is one, returns None otherwise.

pub async fn run<'_, '_>(&'_ mut self, rng: &'_ mut dyn CryptoRngCore)[src]

Runs the reactor until is_stopped() returns true.

pub fn reactor(&self) -> &R[src]

Returns a reference to the reactor.

pub fn reactor_mut(&mut self) -> &mut R[src]

Returns a mutable reference to the reactor.

pub fn into_inner(self) -> R[src]

Deconstructs the runner to return the reactor.

Trait Implementations

impl<R: Debug> Debug for Runner<R> where
    R: Reactor,
    R::Event: Debug
[src]

Auto Trait Implementations

impl<R> !RefUnwindSafe for Runner<R>

impl<R> Send for Runner<R> where
    R: Send,
    <R as Reactor>::Event: Send

impl<R> Sync for Runner<R> where
    R: Sync,
    <R as Reactor>::Event: Send

impl<R> Unpin for Runner<R> where
    R: Unpin

impl<R> !UnwindSafe for Runner<R>

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> FromBits<T> for T[src]

impl<T> Instrument for T[src]

impl<T> Instrument for T[src]

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

impl<T> Same<T> for T

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<V, T> VZip<V> for T where
    V: MultiLane<T>, 

impl<T> WithSubscriber for T[src]