pub struct Expect<H, M> { /* private fields */ }
Trait Implementations§
Source§impl<H, S, E, M> Handler<S, E> for Expect<H, M>
impl<H, S, E, M> Handler<S, E> for Expect<H, M>
Source§type Output = <<H as Handler<S, E>>::Output as Try>::Output
type Output = <<H as Handler<S, E>>::Output as Try>::Output
The output of the event handler when it is matched.
Source§fn call(&mut self, state: &mut S, event: &E) -> Handled<Self::Output>
fn call(&mut self, state: &mut S, event: &E) -> Handled<Self::Output>
Reacts to an event with some state. Read more
Source§fn map<U, F>(self, f: F) -> Map<Self, F>
fn map<U, F>(self, f: F) -> Map<Self, F>
Maps the output of the event handler using the given function.
Source§fn and<H2>(self, handler: H2) -> And<Self, H2>
fn and<H2>(self, handler: H2) -> And<Self, H2>
Executes the handler followed by the given handler if and only if the event is matched by
the first.
Source§fn try_and<H2>(self, handler: H2) -> TryAnd<Self, H2>
fn try_and<H2>(self, handler: H2) -> TryAnd<Self, H2>
Executes the handler followed by the given handler if and only if the event is matched by
the first and the output is not an error. Read more
Source§fn and_then<H2, F>(self, f: F) -> AndThen<Self, F>
fn and_then<H2, F>(self, f: F) -> AndThen<Self, F>
Executes the handler followed by the given function if and only if the event is matched by
the first. The function is given the output of the handler and must return a compatible
handler to execute next.
Source§fn try_and_then<H2, F>(self, f: F) -> TryAndThen<Self, F>
fn try_and_then<H2, F>(self, f: F) -> TryAndThen<Self, F>
Executes the handler followed by the given function if and only if the event is matched by
the first and the output is not an error. The function is given the output of the handler
and must return a compatible handler to execute next. Read more
Source§fn or<H2>(self, handler: H2) -> Or<Self, H2>
fn or<H2>(self, handler: H2) -> Or<Self, H2>
Executes the handler followed by the given handler if and only if the event is not
matched by the first.
Source§fn try_or<H2>(self, handler: H2) -> TryOr<Self, H2>
fn try_or<H2>(self, handler: H2) -> TryOr<Self, H2>
Executes the handler followed by the given handler if the event is not matched by the
first or the output is an error. That is, the given handler is executed only if the first
fails: it does not match the event or it matches but returns an error. Read more
Source§fn try_or_unmatched(self) -> TryOrUnmatched<Self>
fn try_or_unmatched(self) -> TryOrUnmatched<Self>
Source§fn context<C, O, D>(self, context: C) -> Context<Self, C, O, D>
fn context<C, O, D>(self, context: C) -> Context<Self, C, O, D>
Provides context for fallible outputs (like
Result
s).Source§fn expect<M>(self, message: M) -> Expect<Self, M>
fn expect<M>(self, message: M) -> Expect<Self, M>
Panics with the given message if a fallible output indicates an error.
Source§fn expect_matches_times<R>(self, expected: R) -> ExpectMatchesTimes<Self, R>
fn expect_matches_times<R>(self, expected: R) -> ExpectMatchesTimes<Self, R>
Panics if the event handler does not match an event a number of times within the specified
range. Read more
Auto Trait Implementations§
impl<H, M> Freeze for Expect<H, M>
impl<H, M> RefUnwindSafe for Expect<H, M>where
H: RefUnwindSafe,
M: RefUnwindSafe,
impl<H, M> Send for Expect<H, M>
impl<H, M> Sync for Expect<H, M>
impl<H, M> Unpin for Expect<H, M>
impl<H, M> UnwindSafe for Expect<H, M>where
H: UnwindSafe,
M: 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
§impl<T, D> Encode<Ambiguous1, D> for Twhere
D: ResourceDialect,
impl<T, D> Encode<Ambiguous1, D> for Twhere
D: ResourceDialect,
§impl<T, D> Encode<Ambiguous2, D> for Twhere
D: ResourceDialect,
impl<T, D> Encode<Ambiguous2, D> for Twhere
D: ResourceDialect,
§impl<T> IntoAny for T
impl<T> IntoAny for T
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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