pub struct RwSignal<T> { /* private fields */ }
Expand description
A read write Signal which can act as both a Getter and a Setter
Implementations§
Source§impl<T> RwSignal<T>
impl<T> RwSignal<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
Source§impl<T: 'static> RwSignal<T>
impl<T: 'static> RwSignal<T>
pub fn new(value: T) -> Self
pub fn new_split(value: T) -> (ReadSignal<T>, WriteSignal<T>)
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: Clone> SignalGet<T> for RwSignal<T>
impl<T: Clone> SignalGet<T> for RwSignal<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> SignalRead<T> for RwSignal<T>
impl<T> SignalRead<T> for RwSignal<T>
Source§fn read(&self) -> ReadSignalValue<T>where
T: 'static,
fn read(&self) -> ReadSignalValue<T>where
T: 'static,
Reads the data stored in the Signal to a RefCell, so that you can
borrow()
and access the data.
It subscribes to the current running effect.Source§fn read_untracked(&self) -> ReadSignalValue<T>where
T: 'static,
fn read_untracked(&self) -> ReadSignalValue<T>where
T: 'static,
Reads the data stored in the Signal to a RefCell, so that you can
borrow()
and access the data.
It doesn’t subscribe to the current running effect.Source§fn try_read(&self) -> Option<ReadSignalValue<T>>where
T: 'static,
fn try_read(&self) -> Option<ReadSignalValue<T>>where
T: 'static,
If the signal isn’t disposed,
reads the data stored in the Signal to a RefCell, so that you can
borrow()
and access the data.
It subscribes to the current running effect.Source§fn try_read_untracked(&self) -> Option<ReadSignalValue<T>>where
T: 'static,
fn try_read_untracked(&self) -> Option<ReadSignalValue<T>>where
T: 'static,
If the signal isn’t disposed,
reads the data stored in the Signal to a RefCell, so that you can
borrow()
and access the data.
It doesn’t subscribe to the current running effect.Source§impl<T> SignalTrack<T> for RwSignal<T>
impl<T> SignalTrack<T> for RwSignal<T>
Source§impl<T> SignalUpdate<T> for RwSignal<T>
impl<T> SignalUpdate<T> for RwSignal<T>
Source§impl<T> SignalWith<T> for RwSignal<T>
impl<T> SignalWith<T> for RwSignal<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.
Source§impl<T> SignalWrite<T> for RwSignal<T>
impl<T> SignalWrite<T> for RwSignal<T>
Source§fn write(&self) -> WriteSignalValue<T>where
T: 'static,
fn write(&self) -> WriteSignalValue<T>where
T: 'static,
Convert the Signal to
WriteSignalValue
where it holds a RefCell wrapped
original data of the signal, so that you can borrow_mut()
to update the data. Read moreSource§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> Copy for RwSignal<T>
impl<T> Eq for RwSignal<T>
Auto Trait Implementations§
impl<T> Freeze for RwSignal<T>
impl<T> RefUnwindSafe for RwSignal<T>where
T: RefUnwindSafe,
impl<T> Send for RwSignal<T>where
T: Send,
impl<T> Sync for RwSignal<T>where
T: Sync,
impl<T> Unpin for RwSignal<T>where
T: Unpin,
impl<T> UnwindSafe for RwSignal<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