pub trait AsyncAccess<T> {
// Required methods
fn read_async<'a>(
&'a self,
) -> impl Future<Output = AsyncReadGuard<'a, T>> + Send
where T: 'a;
fn write_async<'a>(
&'a self,
) -> impl Future<Output = AsyncWriteGuard<'a, T>> + Send
where T: 'a;
fn get_cloned_async(&self) -> impl Future<Output = T> + Send
where T: Clone;
}Available on crate feature
async only.Expand description
Trait for asynchronous access to shared containers.
Required Methods§
Sourcefn read_async<'a>(
&'a self,
) -> impl Future<Output = AsyncReadGuard<'a, T>> + Sendwhere
T: 'a,
fn read_async<'a>(
&'a self,
) -> impl Future<Output = AsyncReadGuard<'a, T>> + Sendwhere
T: 'a,
Asynchronously acquires a read lock on the container.
Sourcefn write_async<'a>(
&'a self,
) -> impl Future<Output = AsyncWriteGuard<'a, T>> + Sendwhere
T: 'a,
fn write_async<'a>(
&'a self,
) -> impl Future<Output = AsyncWriteGuard<'a, T>> + Sendwhere
T: 'a,
Asynchronously acquires a write lock on the container.
Sourcefn get_cloned_async(&self) -> impl Future<Output = T> + Sendwhere
T: Clone,
fn get_cloned_async(&self) -> impl Future<Output = T> + Sendwhere
T: Clone,
Asynchronously gets a clone of the contained value.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.