pub struct DerivedRwSignal<T: 'static, O, GF: Fn(&T) -> O + Clone + 'static, UF: Fn(&O) -> T + 'static> { /* private fields */ }
Expand description
A signal that is derived from an RwSignal but lets you specify getters and setters for the signal.
This is useful when you want a single state variable and don’t want to use effects to synchronize multiple signals.
This is also useful when you want a derived signal that implements the SignalGet, SignalWith, etc. traits.
Implementations§
Trait Implementations§
Source§impl<T, O, GF: Fn(&T) -> O + Copy, UF: Fn(&O) -> T + Copy> Clone for DerivedRwSignal<T, O, GF, UF>
impl<T, O, GF: Fn(&T) -> O + Copy, UF: Fn(&O) -> T + Copy> Clone for DerivedRwSignal<T, O, GF, UF>
Source§impl<T: Clone + 'static, O: Clone, GF: Fn(&T) -> O + Copy, UF: Fn(&O) -> T + Copy> SignalGet<O> for DerivedRwSignal<T, O, GF, UF>
impl<T: Clone + 'static, O: Clone, GF: Fn(&T) -> O + Copy, UF: Fn(&O) -> T + Copy> SignalGet<O> for DerivedRwSignal<T, O, GF, UF>
Source§fn try_get(&self) -> Option<O>where
O: 'static,
fn try_get(&self) -> Option<O>where
O: '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<O>where
O: 'static,
fn try_get_untracked(&self) -> Option<O>where
O: '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§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§impl<T: Clone + 'static, O: Clone, GF: Fn(&T) -> O + Copy, UF: Fn(&O) -> T + Copy> SignalTrack<O> for DerivedRwSignal<T, O, GF, UF>
impl<T: Clone + 'static, O: Clone, GF: Fn(&T) -> O + Copy, UF: Fn(&O) -> T + Copy> SignalTrack<O> for DerivedRwSignal<T, O, GF, UF>
Source§impl<T: 'static, O, GF: Fn(&T) -> O + Copy, UF: Fn(&O) -> T + Copy> SignalUpdate<O> for DerivedRwSignal<T, O, GF, UF>
impl<T: 'static, O, GF: Fn(&T) -> O + Copy, UF: Fn(&O) -> T + Copy> SignalUpdate<O> for DerivedRwSignal<T, O, GF, UF>
Source§impl<T: Clone + 'static, O: Clone, GF: Fn(&T) -> O + Copy, UF: Fn(&O) -> T + Copy> SignalWith<O> for DerivedRwSignal<T, O, GF, UF>
impl<T: Clone + 'static, O: Clone, GF: Fn(&T) -> O + Copy, UF: Fn(&O) -> T + Copy> SignalWith<O> for DerivedRwSignal<T, O, GF, UF>
Source§fn with<O2>(&self, f: impl FnOnce(&O) -> O2) -> O2where
T: 'static,
fn with<O2>(&self, f: impl FnOnce(&O) -> O2) -> O2where
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<O2>(&self, f: impl FnOnce(&O) -> O2) -> O2where
T: 'static,
fn with_untracked<O2>(&self, f: impl FnOnce(&O) -> O2) -> O2where
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, O, GF: Fn(&T) -> O + Copy, UF: Fn(&O) -> T + Copy> Copy for DerivedRwSignal<T, O, GF, UF>
Auto Trait Implementations§
impl<T, O, GF, UF> Freeze for DerivedRwSignal<T, O, GF, UF>
impl<T, O, GF, UF> RefUnwindSafe for DerivedRwSignal<T, O, GF, UF>
impl<T, O, GF, UF> Send for DerivedRwSignal<T, O, GF, UF>
impl<T, O, GF, UF> Sync for DerivedRwSignal<T, O, GF, UF>
impl<T, O, GF, UF> Unpin for DerivedRwSignal<T, O, GF, UF>where
T: Unpin,
impl<T, O, GF, UF> UnwindSafe for DerivedRwSignal<T, O, GF, UF>
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