Struct medea_reactive::ProgressableCell
source · pub struct ProgressableCell<D>(_);
Expand description
Reactive Cell
with a progress tracking.
Subscription to changes works the same way as in Progressable
, but
working with an underlying data of ProgressableCell
is different in a
way allowing mutating and replacing it.
Implementations§
source§impl<D> ProgressableCell<D>where
D: 'static,
impl<D> ProgressableCell<D>where D: 'static,
source§impl<D> ProgressableCell<D>where
D: Clone + 'static,
impl<D> ProgressableCell<D>where D: Clone + 'static,
sourcepub fn subscribe(&self) -> LocalBoxStream<'static, Guarded<D>>
pub fn subscribe(&self) -> LocalBoxStream<'static, Guarded<D>>
Returns Stream
into which the underlying data updates will be
emitted.
sourcepub fn when_all_processed(&self) -> Processed<'static> ⓘ
pub fn when_all_processed(&self) -> Processed<'static> ⓘ
Returns Future
that will be resolved when all the underlying data
updates will be processed by all subscribers.
source§impl<D> ProgressableCell<D>where
D: Clone + PartialEq + 'static,
impl<D> ProgressableCell<D>where D: Clone + PartialEq + 'static,
sourcepub fn replace(&self, new_data: D) -> D
pub fn replace(&self, new_data: D) -> D
Replaces the wrapped value with a new_data
one, returning the old
value.
sourcepub fn mutate<F>(&self, f: F)where
F: FnOnce(MutObservableFieldGuard<'_, D, SubStore<D>>),
pub fn mutate<F>(&self, f: F)where F: FnOnce(MutObservableFieldGuard<'_, D, SubStore<D>>),
Updates the underlying data using the provided function accepting a mutable reference to the underlying data.
Trait Implementations§
Auto Trait Implementations§
impl<D> !RefUnwindSafe for ProgressableCell<D>
impl<D> !Send for ProgressableCell<D>
impl<D> !Sync for ProgressableCell<D>
impl<D> Unpin for ProgressableCell<D>where D: Unpin,
impl<D> !UnwindSafe for ProgressableCell<D>
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