pub struct Chain<P0, P1>(/* private fields */);Expand description
A pattern for the chain combinator,
chaining values of the two pattern P0 and P1 as a tuple value.
This pattern is created by calling Pattern::chain method.
Implementations§
Trait Implementations§
Source§impl<P0, P1> Pattern for Chain<P0, P1>
impl<P0, P1> Pattern for Chain<P0, P1>
Source§type Value = (<P0 as Pattern>::Value, <P1 as Pattern>::Value)
type Value = (<P0 as Pattern>::Value, <P1 as Pattern>::Value)
The value type associated to the pattern.
Source§fn then<F, P>(self, f: F) -> Then<Self, F>
fn then<F, P>(self, f: F) -> Then<Self, F>
Takes a closure which maps a
Result<Self::Value> to a pattern, and
creates a pattern which calls that closure on the evaluation result of self.Source§fn and_then<F, P>(self, f: F) -> AndThen<Self, F>
fn and_then<F, P>(self, f: F) -> AndThen<Self, F>
Takes a closure which maps a value to a pattern, and
creates a pattern which calls that closure if the evaluation of
self was succeeded.Source§fn or_else<F, P>(self, f: F) -> OrElse<Self, F>
fn or_else<F, P>(self, f: F) -> OrElse<Self, F>
Takes a closure which maps an error to a pattern, and
creates a pattern which calls that closure if the evaluation of
self failed.Source§fn map<F, T>(self, f: F) -> Map<Self, F>
fn map<F, T>(self, f: F) -> Map<Self, F>
Takes a closure which maps a value to another value, and
creates a pattern which calls that closure on the evaluated value of
self.Source§impl<R: Read, P0, P1> ReadFrom<R> for Chain<P0, P1>
impl<R: Read, P0, P1> ReadFrom<R> for Chain<P0, P1>
Source§fn lossless_read_from(self, reader: R) -> Self::Future
fn lossless_read_from(self, reader: R) -> Self::Future
Creates a future instance to read a value of the pattern from
reader.Source§fn read_from(self, reader: R) -> LossyReadFrom<R, Self::Future>
fn read_from(self, reader: R) -> LossyReadFrom<R, Self::Future>
Creates a future instance to read a value of the pattern from
reader. Read moreSource§impl<W: Write, P0, P1> WriteTo<W> for Chain<P0, P1>
impl<W: Write, P0, P1> WriteTo<W> for Chain<P0, P1>
Source§type Future = WriteChain<W, P0, P1>
type Future = WriteChain<W, P0, P1>
The future to write a value of the pattern to
W.Source§fn lossless_write_to(self, writer: W) -> Self::Future
fn lossless_write_to(self, writer: W) -> Self::Future
Creates a future instance to write a value of the pattern to
writer.Source§fn write_to(self, writer: W) -> LossyWriteTo<W, Self::Future>
fn write_to(self, writer: W) -> LossyWriteTo<W, Self::Future>
Creates a future instance to write a value of the pattern to
writer. Read moreAuto Trait Implementations§
impl<P0, P1> Freeze for Chain<P0, P1>
impl<P0, P1> RefUnwindSafe for Chain<P0, P1>where
P0: RefUnwindSafe,
P1: RefUnwindSafe,
impl<P0, P1> Send for Chain<P0, P1>
impl<P0, P1> Sync for Chain<P0, P1>
impl<P0, P1> Unpin for Chain<P0, P1>
impl<P0, P1> UnwindSafe for Chain<P0, P1>where
P0: UnwindSafe,
P1: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more