pub struct RwSignal<T, S = UnsyncStorage> { /* private fields */ }Expand description
A read write Signal which can act as both a Getter and a Setter
Implementations§
Source§impl<T, S> RwSignal<T, S>
impl<T, S> RwSignal<T, S>
Sourcepub fn read_only(&self) -> ReadSignal<T, S>
pub fn read_only(&self) -> ReadSignal<T, S>
Create a Getter of this Signal
Sourcepub fn write_only(&self) -> WriteSignal<T, S>
pub fn write_only(&self) -> WriteSignal<T, S>
Create a Setter of this Signal
Source§impl<T: Send + Sync + 'static> RwSignal<T, SyncStorage>
impl<T: Send + Sync + 'static> RwSignal<T, SyncStorage>
Sourcepub fn new_sync(value: T) -> Self
pub fn new_sync(value: T) -> Self
Creates a sync signal. When called off the UI thread, the signal is left unscoped, so callers must ensure it is disposed manually.
Sourcepub fn new_sync_split(
value: T,
) -> (ReadSignal<T, SyncStorage>, WriteSignal<T, SyncStorage>)
pub fn new_sync_split( value: T, ) -> (ReadSignal<T, SyncStorage>, WriteSignal<T, SyncStorage>)
Creates a sync signal with separate read/write handles. Off-UI calls leave the signal unscoped; the caller is responsible for disposal.
Source§impl<T: 'static> RwSignal<T, UnsyncStorage>
impl<T: 'static> RwSignal<T, UnsyncStorage>
pub fn new(value: T) -> Self
pub fn new_split( value: T, ) -> (ReadSignal<T, UnsyncStorage>, WriteSignal<T, UnsyncStorage>)
Trait Implementations§
Source§impl<T: AddAssign + 'static> AddAssign<T> for RwSignal<T>
impl<T: AddAssign + 'static> AddAssign<T> for RwSignal<T>
Source§fn add_assign(&mut self, rhs: T)
fn add_assign(&mut self, rhs: T)
Performs the
+= operation. Read moreSource§impl<T: BitAndAssign + 'static> BitAndAssign<T> for RwSignal<T>
impl<T: BitAndAssign + 'static> BitAndAssign<T> for RwSignal<T>
Source§fn bitand_assign(&mut self, rhs: T)
fn bitand_assign(&mut self, rhs: T)
Performs the
&= operation. Read moreSource§impl<T: BitOrAssign + 'static> BitOrAssign<T> for RwSignal<T>
impl<T: BitOrAssign + 'static> BitOrAssign<T> for RwSignal<T>
Source§fn bitor_assign(&mut self, rhs: T)
fn bitor_assign(&mut self, rhs: T)
Performs the
|= operation. Read moreSource§impl<T: BitXorAssign + 'static> BitXorAssign<T> for RwSignal<T>
impl<T: BitXorAssign + 'static> BitXorAssign<T> for RwSignal<T>
Source§fn bitxor_assign(&mut self, rhs: T)
fn bitxor_assign(&mut self, rhs: T)
Performs the
^= operation. Read moreSource§impl<T: DivAssign + 'static> DivAssign<T> for RwSignal<T>
impl<T: DivAssign + 'static> DivAssign<T> for RwSignal<T>
Source§fn div_assign(&mut self, rhs: T)
fn div_assign(&mut self, rhs: T)
Performs the
/= operation. Read moreSource§impl<T: MulAssign + 'static> MulAssign<T> for RwSignal<T>
impl<T: MulAssign + 'static> MulAssign<T> for RwSignal<T>
Source§fn mul_assign(&mut self, rhs: T)
fn mul_assign(&mut self, rhs: T)
Performs the
*= operation. Read moreSource§impl<T: RemAssign + 'static> RemAssign<T> for RwSignal<T>
impl<T: RemAssign + 'static> RemAssign<T> for RwSignal<T>
Source§fn rem_assign(&mut self, rhs: T)
fn rem_assign(&mut self, rhs: T)
Performs the
%= operation. Read moreSource§impl<T: ShlAssign + 'static> ShlAssign<T> for RwSignal<T>
impl<T: ShlAssign + 'static> ShlAssign<T> for RwSignal<T>
Source§fn shl_assign(&mut self, rhs: T)
fn shl_assign(&mut self, rhs: T)
Performs the
<<= operation. Read moreSource§impl<T: ShrAssign + 'static> ShrAssign<T> for RwSignal<T>
impl<T: ShrAssign + 'static> ShrAssign<T> for RwSignal<T>
Source§fn shr_assign(&mut self, rhs: T)
fn shr_assign(&mut self, rhs: T)
Performs the
>>= operation. Read moreSource§impl<T> SignalRead<T> for RwSignal<T, UnsyncStorage>
impl<T> SignalRead<T> for RwSignal<T, UnsyncStorage>
Source§fn try_read(&self) -> Option<ReadRef<'_, T>>where
T: 'static,
fn try_read(&self) -> Option<ReadRef<'_, T>>where
T: 'static,
If the signal isn’t disposed,
reads the data stored in the Signal and subscribes to the current running effect.
Source§fn try_read_untracked(&self) -> Option<ReadRef<'_, T>>where
T: 'static,
fn try_read_untracked(&self) -> Option<ReadRef<'_, T>>where
T: 'static,
If the signal isn’t disposed,
reads the data stored in the Signal without subscribing.
Source§fn read(&self) -> ReadRef<'_, T>where
T: 'static,
fn read(&self) -> ReadRef<'_, T>where
T: 'static,
Reads the data stored in the Signal, subscribing the current running effect.
Source§fn read_untracked(&self) -> ReadRef<'_, T>where
T: 'static,
fn read_untracked(&self) -> ReadRef<'_, T>where
T: 'static,
Reads the data stored in the Signal without subscribing.
Source§impl<T: Send + Sync> SignalRead<T> for RwSignal<T, SyncStorage>
impl<T: Send + Sync> SignalRead<T> for RwSignal<T, SyncStorage>
Source§fn try_read(&self) -> Option<ReadRef<'_, T>>where
T: 'static,
fn try_read(&self) -> Option<ReadRef<'_, T>>where
T: 'static,
If the signal isn’t disposed,
reads the data stored in the Signal and subscribes to the current running effect.
Source§fn try_read_untracked(&self) -> Option<ReadRef<'_, T>>where
T: 'static,
fn try_read_untracked(&self) -> Option<ReadRef<'_, T>>where
T: 'static,
If the signal isn’t disposed,
reads the data stored in the Signal without subscribing.
Source§fn read(&self) -> ReadRef<'_, T>where
T: 'static,
fn read(&self) -> ReadRef<'_, T>where
T: 'static,
Reads the data stored in the Signal, subscribing the current running effect.
Source§fn read_untracked(&self) -> ReadRef<'_, T>where
T: 'static,
fn read_untracked(&self) -> ReadRef<'_, T>where
T: 'static,
Reads the data stored in the Signal without subscribing.
Source§impl<T, S> SignalTrack<T> for RwSignal<T, S>
impl<T, S> SignalTrack<T> for RwSignal<T, S>
Source§impl<T> SignalUpdate<T> for RwSignal<T, UnsyncStorage>
impl<T> SignalUpdate<T> for RwSignal<T, UnsyncStorage>
Source§impl<T: Send + Sync> SignalUpdate<T> for RwSignal<T, SyncStorage>
impl<T: Send + Sync> SignalUpdate<T> for RwSignal<T, SyncStorage>
Source§impl<T> SignalWith<T> for RwSignal<T, UnsyncStorage>
impl<T> SignalWith<T> for RwSignal<T, UnsyncStorage>
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,
Source§impl<T: Send + Sync> SignalWith<T> for RwSignal<T, SyncStorage>
impl<T: Send + Sync> SignalWith<T> for RwSignal<T, SyncStorage>
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,
Source§impl<T> SignalWrite<T> for RwSignal<T, UnsyncStorage>
impl<T> SignalWrite<T> for RwSignal<T, UnsyncStorage>
Source§impl<T: Send + Sync> SignalWrite<T> for RwSignal<T, SyncStorage>
impl<T: Send + Sync> SignalWrite<T> for RwSignal<T, SyncStorage>
Source§impl<T: SubAssign + 'static> SubAssign<T> for RwSignal<T>
impl<T: SubAssign + 'static> SubAssign<T> for RwSignal<T>
Source§fn sub_assign(&mut self, rhs: T)
fn sub_assign(&mut self, rhs: T)
Performs the
-= operation. Read moreimpl<T, S> Copy for RwSignal<T, S>
impl<T, S> Eq for RwSignal<T, S>
Auto Trait Implementations§
impl<T, S> Freeze for RwSignal<T, S>
impl<T, S> RefUnwindSafe for RwSignal<T, S>where
T: RefUnwindSafe,
S: RefUnwindSafe,
impl<T, S> Send for RwSignal<T, S>
impl<T, S> Sync for RwSignal<T, S>
impl<T, S> Unpin for RwSignal<T, S>
impl<T, S> UnwindSafe for RwSignal<T, S>where
T: UnwindSafe,
S: 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