pub struct ArcRwSignal<T> { /* private fields */ }Implementations§
Source§impl<T> ArcRwSignal<T>
impl<T> ArcRwSignal<T>
Sourcepub fn read(&self) -> RwLockReadGuard<'_, T>
pub fn read(&self) -> RwLockReadGuard<'_, T>
Get a read guard to the data (like Arc<RwLock
Sourcepub fn write(&self) -> ArcRwSignalWriteGuard<'_, T>
pub fn write(&self) -> ArcRwSignalWriteGuard<'_, T>
Get a write guard to the data (like Arc<RwLock
Sourcepub fn try_read(&self) -> Option<RwLockReadGuard<'_, T>>
pub fn try_read(&self) -> Option<RwLockReadGuard<'_, T>>
Try to get a read guard without blocking
Sourcepub fn try_write(&self) -> Option<ArcRwSignalWriteGuard<'_, T>>
pub fn try_write(&self) -> Option<ArcRwSignalWriteGuard<'_, T>>
Try to get a write guard without blocking
Source§impl<T: Clone> ArcRwSignal<T>
impl<T: Clone> ArcRwSignal<T>
Sourcepub fn get(&self) -> T
pub fn get(&self) -> T
Get a clone of the current value and subscribe to changes in reactive contexts
Sourcepub fn get_untracked(&self) -> T
pub fn get_untracked(&self) -> T
Get a clone of the current value without subscribing to changes
Sourcepub fn update<R>(&self, f: impl FnOnce(&mut T) -> R) -> R
pub fn update<R>(&self, f: impl FnOnce(&mut T) -> R) -> R
Update the value using a closure, notifying all reactive subscribers
Sourcepub fn with<R>(&self, f: impl FnOnce(&T) -> R) -> R
pub fn with<R>(&self, f: impl FnOnce(&T) -> R) -> R
Apply a closure to the current value, subscribing to changes in reactive contexts
Sourcepub fn with_untracked<R>(&self, f: impl FnOnce(&T) -> R) -> R
pub fn with_untracked<R>(&self, f: impl FnOnce(&T) -> R) -> R
Apply a closure to the current value without subscribing to changes
Source§impl<T> ArcRwSignal<T>
impl<T> ArcRwSignal<T>
Sourcepub fn to_read_signal(&self) -> ReadSignal<()>
pub fn to_read_signal(&self) -> ReadSignal<()>
Get a regular ReadSignal that updates when this ArcRwSignal changes.
The returned signal’s value is always () - it’s just for tracking changes.
Sourcepub fn to_write_signal(&self) -> WriteSignal<()>
pub fn to_write_signal(&self) -> WriteSignal<()>
Get a regular WriteSignal that can trigger updates. Writing to this signal will notify subscribers but won’t change the actual data.
Trait Implementations§
Source§impl<T: Clone> Clone for ArcRwSignal<T>
impl<T: Clone> Clone for ArcRwSignal<T>
Source§fn clone(&self) -> ArcRwSignal<T>
fn clone(&self) -> ArcRwSignal<T>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl<T: Send> Send for ArcRwSignal<T>
impl<T: Send + Sync> Sync for ArcRwSignal<T>
Auto Trait Implementations§
impl<T> Freeze for ArcRwSignal<T>
impl<T> !RefUnwindSafe for ArcRwSignal<T>
impl<T> Unpin for ArcRwSignal<T>
impl<T> !UnwindSafe for ArcRwSignal<T>
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more