pub struct Signal<T>where
T: 'static,{ /* private fields */ }Expand description
Zero-overhead Copy handle to a fine-grained reactive signal stored in the arena.
Implementations§
Source§impl<T> Signal<T>where
T: 'static,
Core reactive operations for Signal<T>.
impl<T> Signal<T>where
T: 'static,
Core reactive operations for Signal<T>.
Sourcepub fn new_detached(initial_value: T) -> Self
pub fn new_detached(initial_value: T) -> Self
Sourcepub fn track(&self)
pub fn track(&self)
Records a dependency on this signal in the active observer without cloning its value.
§Arguments
&Self- Signal handle to track.
Sourcepub fn try_get_untracked(&self) -> Option<T>where
T: Clone,
pub fn try_get_untracked(&self) -> Option<T>where
T: Clone,
Sourcepub fn get_untracked(&self) -> T
pub fn get_untracked(&self) -> T
Sourcepub fn set_if_changed(&self, value: T) -> boolwhere
T: PartialEq,
pub fn set_if_changed(&self, value: T) -> boolwhere
T: PartialEq,
Trait Implementations§
Source§impl<T> Clone for Signal<T>where
T: 'static,
Manual Clone implementation so Signal<T> is always Copy regardless of T.
impl<T> Clone for Signal<T>where
T: 'static,
Manual Clone implementation so Signal<T> is always Copy regardless of T.
impl<T> Copy for Signal<T>where
T: 'static,
Marker Copy implementation for Signal<T>.
Source§impl<T> Default for Signal<T>where
T: 'static,
Zero-allocation dangling Default handle for Signal<T>, used when initializing component prop descriptors.
impl<T> Default for Signal<T>where
T: 'static,
Zero-allocation dangling Default handle for Signal<T>, used when initializing component prop descriptors.
impl<T> Eq for Signal<T>where
T: 'static,
Reflexive equality for Signal<T>.
Source§impl<T> Hash for Signal<T>where
T: 'static,
Hash implementation based on underlying SignalId.
impl<T> Hash for Signal<T>where
T: 'static,
Hash implementation based on underlying SignalId.
Auto Trait Implementations§
impl<T> Forget for Signal<T>
impl<T> Freeze for Signal<T>
impl<T> Move 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>
impl<T> UnsafeUnpin for Signal<T>
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