OrChain

Struct OrChain 

Source
pub struct OrChain<R>(/* private fields */);
Expand description

A type that can convert a collection of Reactors into an ordered chain of Or combinators.

Trait Implementations§

Source§

impl<R: Clone> Clone for OrChain<R>

Source§

fn clone(&self) -> OrChain<R>

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<R: Debug> Debug for OrChain<R>

Source§

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

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

impl<T, S, T1, T2, T3, T4, T5, T6, T7, T8> IntoReactor<T, S> for OrChain<(T1, T2, T3, T4, T5, T6, T7, T8)>
where T: Clone, T1: Reactor<T, S>, T2: Reactor<T, S, Response = T1::Response>, T1::Error: From<T2::Error> + From<T3::Error> + From<T4::Error> + From<T5::Error> + From<T6::Error> + From<T7::Error> + From<T8::Error>, T3: Reactor<T, S, Response = T1::Response>, T4: Reactor<T, S, Response = T1::Response>, T5: Reactor<T, S, Response = T1::Response>, T6: Reactor<T, S, Response = T1::Response>, T7: Reactor<T, S, Response = T1::Response>, T8: Reactor<T, S, Response = T1::Response>,

Source§

type Reactor = Or<Or<Or<Or<Or<Or<Or<T1, T2>, T3>, T4>, T5>, T6>, T7>, T8>

Source§

fn into_reactor(self) -> Self::Reactor

Source§

impl<T, S, T2, T3, T4, T5, T6, T7, T8> IntoReactor<T, S> for OrChain<(T2, T3, T4, T5, T6, T7, T8)>
where T: Clone, T2: Reactor<T, S>, T3: Reactor<T, S, Response = T2::Response>, T2::Error: From<T3::Error> + From<T4::Error> + From<T5::Error> + From<T6::Error> + From<T7::Error> + From<T8::Error>, T4: Reactor<T, S, Response = T2::Response>, T5: Reactor<T, S, Response = T2::Response>, T6: Reactor<T, S, Response = T2::Response>, T7: Reactor<T, S, Response = T2::Response>, T8: Reactor<T, S, Response = T2::Response>,

Source§

type Reactor = Or<Or<Or<Or<Or<Or<T2, T3>, T4>, T5>, T6>, T7>, T8>

Source§

fn into_reactor(self) -> Self::Reactor

Source§

impl<T, S, T3, T4, T5, T6, T7, T8> IntoReactor<T, S> for OrChain<(T3, T4, T5, T6, T7, T8)>
where T: Clone, T3: Reactor<T, S>, T4: Reactor<T, S, Response = T3::Response>, T3::Error: From<T4::Error> + From<T5::Error> + From<T6::Error> + From<T7::Error> + From<T8::Error>, T5: Reactor<T, S, Response = T3::Response>, T6: Reactor<T, S, Response = T3::Response>, T7: Reactor<T, S, Response = T3::Response>, T8: Reactor<T, S, Response = T3::Response>,

Source§

type Reactor = Or<Or<Or<Or<Or<T3, T4>, T5>, T6>, T7>, T8>

Source§

fn into_reactor(self) -> Self::Reactor

Source§

impl<T, S, T4, T5, T6, T7, T8> IntoReactor<T, S> for OrChain<(T4, T5, T6, T7, T8)>
where T: Clone, T4: Reactor<T, S>, T5: Reactor<T, S, Response = T4::Response>, T4::Error: From<T5::Error> + From<T6::Error> + From<T7::Error> + From<T8::Error>, T6: Reactor<T, S, Response = T4::Response>, T7: Reactor<T, S, Response = T4::Response>, T8: Reactor<T, S, Response = T4::Response>,

Source§

type Reactor = Or<Or<Or<Or<T4, T5>, T6>, T7>, T8>

Source§

fn into_reactor(self) -> Self::Reactor

Source§

impl<T, S, T5, T6, T7, T8> IntoReactor<T, S> for OrChain<(T5, T6, T7, T8)>
where T: Clone, T5: Reactor<T, S>, T6: Reactor<T, S, Response = T5::Response>, T5::Error: From<T6::Error> + From<T7::Error> + From<T8::Error>, T7: Reactor<T, S, Response = T5::Response>, T8: Reactor<T, S, Response = T5::Response>,

Source§

type Reactor = Or<Or<Or<T5, T6>, T7>, T8>

Source§

fn into_reactor(self) -> Self::Reactor

Source§

impl<T, S, T6, T7, T8> IntoReactor<T, S> for OrChain<(T6, T7, T8)>
where T: Clone, T6: Reactor<T, S>, T7: Reactor<T, S, Response = T6::Response>, T6::Error: From<T7::Error> + From<T8::Error>, T8: Reactor<T, S, Response = T6::Response>,

Source§

type Reactor = Or<Or<T6, T7>, T8>

Source§

fn into_reactor(self) -> Self::Reactor

Source§

impl<T, S, T7, T8> IntoReactor<T, S> for OrChain<(T7, T8)>
where T: Clone, T7: Reactor<T, S>, T8: Reactor<T, S, Response = T7::Response>, T7::Error: From<T8::Error>,

Source§

type Reactor = Or<T7, T8>

Source§

fn into_reactor(self) -> Self::Reactor

Source§

impl<T, S, R> IntoReactor<T, S> for OrChain<Vec<R>>
where T: Clone, R: Reactor<T, S>,

Source§

type Reactor = OrChain<Dynamic<Vec<R>>>

Source§

fn into_reactor(self) -> Self::Reactor

Source§

impl<T, S, R> Reactor<T, S> for OrChain<Dynamic<Vec<R>>>
where T: Clone, R: Reactor<T, S>,

Source§

type Response = <R as Reactor<T, S>>::Response

The output type of successful responses from the reactor.
Source§

type Error = <R as Reactor<T, S>>::Error

The error type of failed responses from the reactor.
Source§

fn react( &mut self, event: Timed<Event<T>>, context: Context<'_, S>, ) -> Result<Self::Response, Self::Error>

Reacts to a timed Event. Read more
Source§

fn map_response<P, F>(self, f: F) -> MapResponse<Self, F>
where Self: Sized, F: FnMut(Self::Response) -> P,

Source§

fn map_error<E, F>(self, f: F) -> MapError<Self, F>
where Self: Sized, F: FnMut(Self::Error) -> E,

Source§

fn respond<P>(self, response: P) -> Respond<Self, P>
where Self: Sized, P: Clone,

Reacts with this reactor and then responds with the given response, regardless of this reactor’s output.
Source§

fn fail<E>(self, error: E) -> Fail<Self, E>
where Self: Sized, E: Clone,

Reacts with this reactor and then fails with the given error, regardless of this reactor’s output.
Source§

fn then<R>(self, reactor: R) -> Then<Self, R>
where Self: Sized, T: Clone, R: Reactor<T, S>,

Reacts with this reactor and then the given reactor (regardless of outputs). Read more
Source§

fn and<R>(self, reactor: R) -> And<Self, R>
where Self: Sized, Self::Error: From<R::Error>, T: Clone, R: Reactor<T, S>,

Reacts with this reactor and then the given reactor if and only if this reactor returns Ok. Read more
Source§

fn or<R>(self, reactor: R) -> Or<Self, R>
where Self: Sized, T: Clone, R: Reactor<T, S, Response = Self::Response>,

Reacts with this reactor and then the given reactor if and only if this reactor returns Err. Read more
Source§

fn inspect<F>( self, f: F, ) -> impl Reactor<T, S, Response = Self::Response, Error = Self::Error>
where Self: Sized, T: Clone, F: FnMut(&Timed<Event<T>>, &Result<Self::Response, Self::Error>),

Constructs a Reactor that inspects the event and output of self with the given function.
Source§

impl<R: Copy> Copy for OrChain<R>

Auto Trait Implementations§

§

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

§

impl<R> RefUnwindSafe for OrChain<R>
where R: RefUnwindSafe,

§

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

§

impl<R> Sync for OrChain<R>
where R: Sync,

§

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

§

impl<R> UnwindSafe for OrChain<R>
where R: UnwindSafe,

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DynClone for T
where T: Clone,

Source§

fn __clone_box(&self, _: Private) -> *mut ()

§

impl<T, D> Encode<Ambiguous1, D> for T
where D: ResourceDialect,

§

unsafe fn encode( self, _encoder: &mut Encoder<'_, D>, _offset: usize, _depth: Depth, ) -> Result<(), Error>

Encodes the object into the encoder’s buffers. Any handles stored in the object are swapped for Handle::INVALID. Read more
§

impl<T, D> Encode<Ambiguous2, D> for T
where D: ResourceDialect,

§

unsafe fn encode( self, _encoder: &mut Encoder<'_, D>, _offset: usize, _depth: Depth, ) -> Result<(), Error>

Encodes the object into the encoder’s buffers. Any handles stored in the object are swapped for Handle::INVALID. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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
§

impl<T> Pointable for T

§

const ALIGN: usize

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<R, T> ReactorExt<T> for R
where R: Reactor<T>,

Source§

fn react_to_data_record( &mut self, record: T, ) -> Result<Self::Response, Self::Error>
where S: Default,

Reacts to a data record. Read more
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. 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.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V