Skip to main content

Machine

Struct Machine 

Source
pub struct Machine<R> { /* private fields */ }

Implementations§

Source§

impl<R: ClarifiedCerrMerging + 'static> Machine<R>

Source

pub fn big_red_and_btn( self, ) -> Either<Result<Result<(R, MachineMeta), cerr>, FatalError>, UnfinishedMachine<R>> ⓘ

Source§

impl<R> Machine<R>

Source

pub fn with_action(self, action: RuntimeAction) -> Self

Source

pub fn require_features(self, required_features: Features) -> Self

Add extra features that need to be enabled for the current expression to be usable. Already present features will be ignored (bitwise or)

Source

pub fn from_final(v: R) -> Self

Source§

impl<R: ClarifiedCerrMerging + 'static> Machine<R>

Source

pub fn maybe_merge_catchable(self) -> Self

Source

pub fn query<U>( self, closure: impl FnOnce(R) -> Machine<U> + 'static + Send, ) -> Machine<U>

Alias of Self::and_then

Source

pub fn and_then<U>( self, closure: impl FnOnce(R) -> Machine<U> + 'static + Send, ) -> Machine<U>

Source

pub fn map<U>(self, closure: impl FnOnce(R) -> U + 'static + Send) -> Machine<U>

Source§

impl<R: From<cerr>> Machine<R>

Source

pub fn merge_catchables(self) -> Self

Types that can wrap cerr offer a second place inside Machine where errors can be stored. This method ensures that all catchable errors are stored as part of the main value and not in the Machine-specific variant for errors that exist for all wrapped types. This ensures that closures that explicitly want to process errors, still see all errors.

This method is only available if the operation is useful, see Machine::maybe_merge_catchable for a version that works on more types.

Trait Implementations§

Source§

impl<R> Debug for Machine<R>

Source§

fn fmt(&self, __derive_more_f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'a, R: MachineReturnVal + Clone> From<Cow<'a, R>> for Machine<R>

Source§

fn from(value: Cow<'a, R>) -> Self

Converts to this type from the input type.
Source§

impl<R> From<FatalError> for Machine<R>

Source§

fn from(err: FatalError) -> Machine<R>

Converts to this type from the input type.
Source§

impl<R: MachineReturnVal> From<R> for Machine<R>

Source§

fn from(value: R) -> Self

Converts to this type from the input type.
Source§

impl<R: ClarifiedCerrMerging + 'static> From<Result<Machine<R>, cerr>> for Machine<R>

Source§

fn from(value: Result<Machine<R>, cerr>) -> Self

Converts to this type from the input type.
Source§

impl<R: ClarifiedCerrMerging + 'static> From<Result<R, cerr>> for Machine<R>

Source§

fn from(value: Result<R, cerr>) -> Self

Converts to this type from the input type.
Source§

impl<R: ClarifiedCerrMerging + 'static> From<cerr> for Machine<R>

Source§

fn from(value: cerr) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

§

impl<R> !RefUnwindSafe for Machine<R>

§

impl<R> !Sync for Machine<R>

§

impl<R> !UnwindSafe for Machine<R>

§

impl<R> Freeze for Machine<R>
where R: Freeze,

§

impl<R> Send for Machine<R>
where R: Send,

§

impl<R> Unpin for Machine<R>
where R: Unpin,

§

impl<R> UnsafeUnpin for Machine<R>
where R: UnsafeUnpin,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

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

Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
where F: FnOnce(&Self) -> bool,

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
Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more