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,

source

pub fn new(data: D) -> Self

Returns new ProgressableCell.

source

pub fn borrow(&self) -> Ref<'_, D>

Returns immutable reference to underlying data.

source§

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

source

pub fn get(&self) -> D

Returns copy of an underlying data.

source

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

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

source

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,

source

pub fn set(&self, new_data: D)

Replaces the wrapped value with a new_data one.

source

pub fn replace(&self, new_data: D) -> D

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

source

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§

source§

impl<D: Debug> Debug for ProgressableCell<D>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

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> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

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

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.