pub enum Context<S> {
    State(S),
    Deferred(Box<Deferred<S>>),
}
Expand description

Deferred execution context holds its state or inner deferred execution (if there is deferred subroutine needed to evaluate).

Variants§

§

State(S)

Context holds single state.

§

Deferred(Box<Deferred<S>>)

Context holds deferred subroutine needed to evaluate.

Implementations§

Tells if context holds a state.

Tells if context holds a deferred subroutine to evaluate.

Gets reference to current state if there is one hold by context or its deferred subroutine.

Gets deferred subroutine if context has one.

Consumes context and returns its state.

Consumes context and returns its deferred subroutine.

Panics
  • when context does not hold deferred subroutine so you should make sure about that by calling self.is_deferred() before gettin context deferred subroutine.

Alias for state() method.

Trait Implementations§

Converts this type into the (usually inferred) input type.

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.