pub struct Signal<T>(/* private fields */);Implementations§
Source§impl<T: Clone + 'static> Signal<T>
impl<T: Clone + 'static> Signal<T>
pub fn new(init: T) -> Selfwhere
T: PartialEq,
pub fn new_with_eq_fn(init: T, eq_fn: impl Fn(&T, &T) -> bool + 'static) -> Self
pub fn get(&self) -> T
pub fn set(&self, value: T)
pub fn update(&self, f: impl FnOnce(&mut T))
👎Deprecated since 0.1.4: use
.set_mut() insteadpub fn set_mut(&self, f: impl FnOnce(&mut T))
Trait Implementations§
Auto Trait Implementations§
impl<T> Freeze for Signal<T>
impl<T> !RefUnwindSafe for Signal<T>
impl<T> !Send for Signal<T>
impl<T> !Sync for Signal<T>
impl<T> Unpin for Signal<T>where
T: Unpin,
impl<T> !UnwindSafe for Signal<T>
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