Struct medea_reactive::ProgressableCell[][src]

pub struct ProgressableCell<D>(_);

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

impl<D> ProgressableCell<D> where
    D: 'static, 
[src]

#[must_use]pub fn new(data: D) -> Self[src]

Returns new ProgressableCell.

#[must_use]pub fn borrow(&self) -> Ref<'_, D>[src]

Returns immutable reference to underlying data.

impl<D> ProgressableCell<D> where
    D: Clone + 'static, 
[src]

#[must_use]pub fn get(&self) -> D[src]

Returns copy of an underlying data.

pub fn subscribe(&self) -> LocalBoxStream<'static, Guarded<D>>[src]

Returns Stream into which the underlying data updates will be emitted.

pub fn when_all_processed(&self) -> Processed<'static>

Notable traits for Processed<'a, T>

impl<'a, T> Future for Processed<'a, T> type Output = T;
[src]

Returns Future that will be resolved when all the underlying data updates will be processed by all subscribers.

impl<D> ProgressableCell<D> where
    D: Clone + PartialEq + 'static, 
[src]

pub fn set(&self, new_data: D)[src]

Replaces the wrapped value with a new_data one.

#[must_use]pub fn replace(&self, new_data: D) -> D[src]

Replaces the wrapped value with a new_data one, returning the old value.

pub fn mutate<F>(&self, f: F) where
    F: FnOnce(MutObservableFieldGuard<'_, D, SubStore<D>>), 
[src]

Updates the underlying data using the provided function accepting a mutable reference to the underlying data.

Trait Implementations

impl<D: Debug> Debug for ProgressableCell<D>[src]

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

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.