pub struct Update<Ef, Ev> {
pub effects: Vec<Ef>,
pub events: Vec<Ev>,
}
Expand description
Update test helper holds the result of running an app update using AppTester::update
or resolving a request with AppTester::resolve
.
Fields§
§effects: Vec<Ef>
Effects requested from the update run
events: Vec<Ev>
Events dispatched from the update run
Implementations§
Source§impl<Ef, Ev> Update<Ef, Ev>
impl<Ef, Ev> Update<Ef, Ev>
pub fn into_effects(self) -> impl Iterator<Item = Ef>
pub fn effects(&self) -> impl Iterator<Item = &Ef>
pub fn effects_mut(&mut self) -> impl Iterator<Item = &mut Ef>
Sourcepub fn expect_one_effect(self) -> Ef
pub fn expect_one_effect(self) -> Ef
Assert that the update contains exactly one effect and zero events, and return the effect
§Panics
Panics if the update contains more than one effect or any events.
Sourcepub fn expect_one_event(self) -> Ev
pub fn expect_one_event(self) -> Ev
Assert that the update contains exactly one event and zero effects, and return the event
§Panics
Panics if the update contains more than one event or any effects.
Sourcepub fn assert_empty(self)
pub fn assert_empty(self)
Assert that the update contains no effects or events
§Panics
Panics if the update contains any effects or events.
Sourcepub fn take_effects<P>(&mut self, predicate: P) -> VecDeque<Ef>
pub fn take_effects<P>(&mut self, predicate: P) -> VecDeque<Ef>
Take effects matching the predicate
out of the Update
and return them, mutating the Update
Trait Implementations§
Auto Trait Implementations§
impl<Ef, Ev> Freeze for Update<Ef, Ev>
impl<Ef, Ev> RefUnwindSafe for Update<Ef, Ev>where
Ef: RefUnwindSafe,
Ev: RefUnwindSafe,
impl<Ef, Ev> Send for Update<Ef, Ev>
impl<Ef, Ev> Sync for Update<Ef, Ev>
impl<Ef, Ev> Unpin for Update<Ef, Ev>
impl<Ef, Ev> UnwindSafe for Update<Ef, Ev>where
Ef: UnwindSafe,
Ev: 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