pub struct BaseSignal<T: 'static> { /* private fields */ }Expand description
BaseSignal gives you another way to control the lifetime of a Signal apart from Scope. This unsync variant stores its value on the UI thread.
When BaseSignal is dropped, it will dispose the underlying Signal as well. The signal isn’t put in any Scope when a BaseSignal is created, so that the lifetime of the signal can only be determined by BaseSignal rather than Scope dependencies.
Implementations§
Source§impl<T: 'static> BaseSignal<T>
impl<T: 'static> BaseSignal<T>
pub fn new(value: T) -> Self
Sourcepub fn read_only(&self) -> ReadSignal<T>
pub fn read_only(&self) -> ReadSignal<T>
Create a Getter of this Signal
Sourcepub fn write_only(&self) -> WriteSignal<T>
pub fn write_only(&self) -> WriteSignal<T>
Create a Setter of this Signal
Trait Implementations§
Source§impl<T: 'static> Drop for BaseSignal<T>
impl<T: 'static> Drop for BaseSignal<T>
Source§impl<T: 'static> PartialEq for BaseSignal<T>
impl<T: 'static> PartialEq for BaseSignal<T>
Source§impl<T: Clone + 'static> SignalGet<T> for BaseSignal<T>
impl<T: Clone + 'static> SignalGet<T> for BaseSignal<T>
Source§impl<T: 'static> SignalUpdate<T> for BaseSignal<T>
impl<T: 'static> SignalUpdate<T> for BaseSignal<T>
Source§impl<T: Clone + 'static> SignalWith<T> for BaseSignal<T>
impl<T: Clone + 'static> SignalWith<T> for BaseSignal<T>
fn with<O>(&self, f: impl FnOnce(&T) -> O) -> Owhere
T: 'static,
fn with_untracked<O>(&self, f: impl FnOnce(&T) -> O) -> Owhere
T: 'static,
fn try_with<O>(&self, f: impl FnOnce(Option<&T>) -> O) -> Owhere
T: 'static,
fn try_with_untracked<O>(&self, f: impl FnOnce(Option<&T>) -> O) -> Owhere
T: 'static,
impl<T: 'static> Eq for BaseSignal<T>
Auto Trait Implementations§
impl<T> Freeze for BaseSignal<T>
impl<T> RefUnwindSafe for BaseSignal<T>where
T: RefUnwindSafe,
impl<T> Send for BaseSignal<T>where
T: Send,
impl<T> Sync for BaseSignal<T>where
T: Sync,
impl<T> Unpin for BaseSignal<T>where
T: Unpin,
impl<T> UnwindSafe for BaseSignal<T>where
T: UnwindSafe,
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