pub struct Signal<T> { /* private fields */ }Expand description
A value bindings read.
Implementations§
Source§impl<T: Clone + PartialEq + 'static> Signal<T>
impl<T: Clone + PartialEq + 'static> Signal<T>
Sourcepub fn with<R>(&self, f: impl FnOnce(&T) -> R) -> R
pub fn with<R>(&self, f: impl FnOnce(&T) -> R) -> R
FRAME-17: f of its value, borrowed — tracked, and never cloned.
FRAME-17: its value as held — tracked; the same Rc until it is
set again, so a reader may keep what it made of it and know when
that is stale (Rc::ptr_eq).
Sourcepub fn set(&self, value: T)
pub fn set(&self, value: T)
Sets it; the bindings that read it run again when the value differs.
Trait Implementations§
Auto Trait Implementations§
impl<T> !RefUnwindSafe for Signal<T>
impl<T> !Send for Signal<T>
impl<T> !Sync for Signal<T>
impl<T> !UnwindSafe for Signal<T>
impl<T> Forget for Signal<T>
impl<T> Freeze for Signal<T>where
PhantomData<T>: Freeze,
impl<T> Move for Signal<T>
impl<T> Unpin for Signal<T>where
PhantomData<T>: Unpin,
impl<T> UnsafeUnpin for Signal<T>where
PhantomData<T>: UnsafeUnpin,
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<T> Variant for T
impl<T> Variant for T
Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert this
Variant trait object to &mut dyn Any.Source§fn as_boxed_any(self: Box<T>) -> Box<dyn Any>
fn as_boxed_any(self: Box<T>) -> Box<dyn Any>
Convert this
Variant trait object to Box<dyn Any>.