Trait AsStoreRef
pub(crate) trait AsStoreRef {
// Required method
fn as_store_ref(&self) -> StoreRef<'_>;
// Provided method
fn as_store_async(&self) -> Option<impl AsStoreAsync + 'static> { ... }
}Expand description
Helper trait for a value that is convertible to a [StoreRef].
Required Methods§
fn as_store_ref(&self) -> StoreRef<'_>
fn as_store_ref(&self) -> StoreRef<'_>
Returns a StoreRef pointing to the underlying context.
Provided Methods§
fn as_store_async(&self) -> Option<impl AsStoreAsync + 'static>
fn as_store_async(&self) -> Option<impl AsStoreAsync + 'static>
Returns a [StoreAsync] if the current
context is asynchronous. The store will be locked since
it’s already active in the current context, but can be used
to spawn new coroutines via
Function::call_async.
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.