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
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
sourcepub fn assert_empty(self)
pub fn assert_empty(self)
Assert that the update contains no 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