Struct medea_reactive::ProgressableCell [−][src]
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]
D: 'static,
#[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]
D: Clone + 'static,
#[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>ⓘ
[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]
D: Clone + PartialEq + 'static,
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]
F: FnOnce(MutObservableFieldGuard<'_, D, SubStore<D>>),
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,
D: Unpin,
impl<D> !UnwindSafe for ProgressableCell<D>
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,