pub struct Pending<T> { /* private fields */ }Expand description
Effect ids still waiting for their answer, each with what the app was doing when it asked.
Keeps resolve a match on a state-machine enum instead of scattered flags.
Implementations§
Source§impl<T> Pending<T>
impl<T> Pending<T>
Sourcepub fn emit<X>(&mut self, ctx: &mut Ctx<X>, effect: Effect<X>, what: T) -> u64
pub fn emit<X>(&mut self, ctx: &mut Ctx<X>, effect: Effect<X>, what: T) -> u64
Emit effect and remember what under its id.
Sourcepub fn take(&mut self, id: u64) -> Option<T>
pub fn take(&mut self, id: u64) -> Option<T>
The remembered state for an answered id; None for an id this app never tracked (or a
stale one).
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
Trait Implementations§
impl<T: Eq> Eq for Pending<T>
impl<T: PartialEq> StructuralPartialEq for Pending<T>
Auto Trait Implementations§
impl<T> Forget for Pending<T>
impl<T> Freeze for Pending<T>
impl<T> Move for Pending<T>
impl<T> RefUnwindSafe for Pending<T>
impl<T> Send for Pending<T>
impl<T> Sync for Pending<T>
impl<T> Unpin for Pending<T>
impl<T> UnsafeUnpin for Pending<T>
impl<T> UnwindSafe for Pending<T>
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