pub struct BaseSignal<T> { /* private fields */ }
Expand description
BaseSignal gives you another way to control the lifetime of a Signal apart from Scope.
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> BaseSignal<T>
impl<T> BaseSignal<T>
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> Drop for BaseSignal<T>
impl<T> Drop for BaseSignal<T>
Source§impl<T> PartialEq for BaseSignal<T>
impl<T> PartialEq for BaseSignal<T>
Source§impl<T: Clone> SignalGet<T> for BaseSignal<T>
impl<T: Clone> SignalGet<T> for BaseSignal<T>
Source§fn get_untracked(&self) -> Twhere
T: 'static,
fn get_untracked(&self) -> Twhere
T: 'static,
Clones and returns the current value stored in the Signal, but it doesn’t subscribe
to the current running effect.
Source§fn get(&self) -> Twhere
T: 'static,
fn get(&self) -> Twhere
T: 'static,
Clones and returns the current value stored in the Signal, and subscribes
to the current running effect to this Signal.
Source§fn try_get(&self) -> Option<T>where
T: 'static,
fn try_get(&self) -> Option<T>where
T: 'static,
Try to clone and return the current value stored in the Signal, and returns None
if it’s already disposed. It subscribes to the current running effect.
Source§fn try_get_untracked(&self) -> Option<T>where
T: 'static,
fn try_get_untracked(&self) -> Option<T>where
T: 'static,
Try to clone and return the current value stored in the Signal, and returns None
if it’s already disposed. It doesn’t subscribe to the current running effect.
Source§impl<T> SignalUpdate<T> for BaseSignal<T>
impl<T> SignalUpdate<T> for BaseSignal<T>
Source§impl<T> SignalWith<T> for BaseSignal<T>
impl<T> SignalWith<T> for BaseSignal<T>
Source§fn with<O>(&self, f: impl FnOnce(&T) -> O) -> Owhere
T: 'static,
fn with<O>(&self, f: impl FnOnce(&T) -> O) -> Owhere
T: 'static,
Applies a closure to the current value stored in the Signal, and subscribes
to the current running effect to this Memo.
Source§fn with_untracked<O>(&self, f: impl FnOnce(&T) -> O) -> Owhere
T: 'static,
fn with_untracked<O>(&self, f: impl FnOnce(&T) -> O) -> Owhere
T: 'static,
Applies a closure to the current value stored in the Signal, but it doesn’t subscribe
to the current running effect.
impl<T> 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