pub struct StoreAsync {
pub(crate) id: StoreId,
pub(crate) inner: LocalRwLock<Box<StoreInner>>,
}Expand description
A store that can be used to invoke
Function::call_async.
Fields§
§id: StoreId§inner: LocalRwLock<Box<StoreInner>>Implementations§
Source§impl StoreAsync
impl StoreAsync
pub(crate) fn from_context(id: StoreId) -> Option<Self>
Sourcepub fn into_store(self) -> Result<Store, Self>
pub fn into_store(self) -> Result<Store, Self>
Transform this StoreAsync back into a Store
if this is the only clone of it and is unlocked.
Sourcepub fn read(&self) -> StoreAsyncReadLock
pub fn read(&self) -> StoreAsyncReadLock
Acquire a read lock on the store. Panics if the store is locked for writing.
Sourcepub fn write(self) -> StoreAsyncWriteLock
pub fn write(self) -> StoreAsyncWriteLock
Acquire a write lock on the store. Panics if the store is locked.
Trait Implementations§
Source§impl AsStoreAsync for StoreAsync
impl AsStoreAsync for StoreAsync
Source§fn store_ref(&self) -> &StoreAsync
fn store_ref(&self) -> &StoreAsync
Returns a reference to the inner store.
Source§fn store(&self) -> StoreAsync
fn store(&self) -> StoreAsync
Returns a copy of the store.
Source§fn read_lock(&self) -> impl Future<Output = StoreAsyncReadLock>
fn read_lock(&self) -> impl Future<Output = StoreAsyncReadLock>
Acquires a read lock on the store.
Source§fn write_lock(&self) -> impl Future<Output = StoreAsyncWriteLock>
fn write_lock(&self) -> impl Future<Output = StoreAsyncWriteLock>
Acquires a write lock on the store.
Auto Trait Implementations§
impl Freeze for StoreAsync
impl !RefUnwindSafe for StoreAsync
impl !Send for StoreAsync
impl !Sync for StoreAsync
impl Unpin for StoreAsync
impl !UnwindSafe for StoreAsync
Blanket Implementations§
§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
§type ArchivedMetadata = ()
type ArchivedMetadata = ()
The archived version of the pointer metadata for this type.
§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
Converts some archived metadata to the pointer metadata for itself.
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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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>
Converts
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>
Converts
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§impl<T> LayoutRaw for T
impl<T> LayoutRaw for T
§fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
Returns the layout of the type.