pub struct AsyncShared<T> { /* private fields */ }Available on crate feature
async only.Expand description
An asynchronous shared container using tokio primitives.
Only available with the async feature flag.
Implementations§
Sourcepub fn downgrade(&self) -> WeakAsyncShared<T>
pub fn downgrade(&self) -> WeakAsyncShared<T>
Creates a weak reference to this container.
Trait Implementations§
Source§async fn read_async<'a>(&'a self) -> AsyncReadGuard<'a, T>where
T: 'a,
async fn read_async<'a>(&'a self) -> AsyncReadGuard<'a, T>where
T: 'a,
Asynchronously acquires a read lock on the container.
Source§async fn write_async<'a>(&'a self) -> AsyncWriteGuard<'a, T>where
T: 'a,
async fn write_async<'a>(&'a self) -> AsyncWriteGuard<'a, T>where
T: 'a,
Asynchronously acquires a write lock on the container.
Source§async fn get_cloned_async(&self) -> Twhere
T: Clone,
async fn get_cloned_async(&self) -> Twhere
T: Clone,
Asynchronously gets a clone of the contained value.
Source§fn from(shared: AsyncShared<T>) -> Self
fn from(shared: AsyncShared<T>) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
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