Trait AsStoreAsync

Source
pub trait AsStoreAsync {
    // Required method
    fn store_ref(&self) -> &StoreAsync;

    // Provided methods
    fn store(&self) -> StoreAsync { ... }
    fn store_id(&self) -> StoreId { ... }
    fn read_lock(&self) -> impl Future<Output = StoreAsyncReadLock> { ... }
    fn write_lock(&self) -> impl Future<Output = StoreAsyncWriteLock> { ... }
}
Expand description

A trait for types that can be used with Function::call_async.

Required Methods§

Source

fn store_ref(&self) -> &StoreAsync

Returns a reference to the inner store.

Provided Methods§

Source

fn store(&self) -> StoreAsync

Returns a copy of the store.

Source

fn store_id(&self) -> StoreId

Returns the store id.

Source

fn read_lock(&self) -> impl Future<Output = StoreAsyncReadLock>

Acquires a read lock on the store.

Source

fn write_lock(&self) -> impl Future<Output = StoreAsyncWriteLock>

Acquires a write lock on the store.

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.

Implementors§