WatchedValueCore

Trait WatchedValueCore 

Source
pub trait WatchedValueCore<'ctx, O: ?Sized> {
    type Value;

    // Required methods
    fn get(self, ctx: WatchArg<'_, 'ctx, O>) -> Self::Value;
    fn get_unwatched(self) -> Self::Value;

    // Provided method
    fn map<F, U>(self, map_fn: F) -> impl WatchedValueCore<'ctx, O, Value = U>
       where Self: Sized,
             F: FnOnce(Self::Value) -> U { ... }
}

Required Associated Types§

Required Methods§

Source

fn get(self, ctx: WatchArg<'_, 'ctx, O>) -> Self::Value

Source

fn get_unwatched(self) -> Self::Value

Provided Methods§

Source

fn map<F, U>(self, map_fn: F) -> impl WatchedValueCore<'ctx, O, Value = U>
where Self: Sized, F: FnOnce(Self::Value) -> U,

Implementations on Foreign Types§

Source§

impl<'ctx, T, O> WatchedValueCore<'ctx, O> for Box<T>
where T: ?Sized + WatchedValueCore<'ctx, O>, O: ?Sized,

Source§

type Value = <T as WatchedValueCore<'ctx, O>>::Value

Source§

fn get(self, ctx: WatchArg<'_, 'ctx, O>) -> Self::Value

Source§

fn get_unwatched(self) -> Self::Value

Implementors§

Source§

impl<'a, 'ctx, O, T> WatchedValueCore<'ctx, O> for &'a WatchedCore<'ctx, T, O>
where O: ?Sized, T: ?Sized,

Source§

impl<'a, T> WatchedValueCore<'static, DefaultOwner> for &'a Watched<T>
where T: ?Sized,

Source§

impl<'ctx, O, T> WatchedValueCore<'ctx, O> for &WatchedCellCore<'ctx, T, O>
where O: ?Sized, T: Copy,

Source§

type Value = T

Source§

impl<T> WatchedValueCore<'static, DefaultOwner> for &WatchedCell<T>
where T: Copy,

Source§

type Value = T