Struct wasmer_vm::store::InternalStoreHandle
source · #[repr(transparent)]pub struct InternalStoreHandle<T> {
idx: NonZeroUsize,
marker: PhantomData<fn() -> T>,
}
Expand description
Internal handle to an object owned by the current context.
Unlike StoreHandle
this does not track the context ID: it is only
intended to be used within objects already owned by a context.
Fields§
§idx: NonZeroUsize
§marker: PhantomData<fn() -> T>
Implementations§
source§impl<T: StoreObject> InternalStoreHandle<T>
impl<T: StoreObject> InternalStoreHandle<T>
sourcepub fn new(ctx: &mut StoreObjects, val: T) -> Self
pub fn new(ctx: &mut StoreObjects, val: T) -> Self
Moves the given object into a context and returns a handle to it.
sourcepub fn get<'a>(&self, ctx: &'a StoreObjects) -> &'a T
pub fn get<'a>(&self, ctx: &'a StoreObjects) -> &'a T
Returns a reference to the object that this handle points to.
sourcepub fn get_mut<'a>(&self, ctx: &'a mut StoreObjects) -> &'a mut T
pub fn get_mut<'a>(&self, ctx: &'a mut StoreObjects) -> &'a mut T
Returns a mutable reference to the object that this handle points to.
pub(crate) fn index(&self) -> usize
pub(crate) fn from_index(idx: usize) -> Option<Self>
Trait Implementations§
source§impl<T> Clone for InternalStoreHandle<T>
impl<T> Clone for InternalStoreHandle<T>
source§impl<T> Debug for InternalStoreHandle<T>
impl<T> Debug for InternalStoreHandle<T>
source§impl<T> PartialEq for InternalStoreHandle<T>
impl<T> PartialEq for InternalStoreHandle<T>
impl<T> Copy for InternalStoreHandle<T>
impl<T> Eq for InternalStoreHandle<T>
Auto Trait Implementations§
impl<T> Freeze for InternalStoreHandle<T>
impl<T> RefUnwindSafe for InternalStoreHandle<T>
impl<T> Send for InternalStoreHandle<T>
impl<T> Sync for InternalStoreHandle<T>
impl<T> Unpin for InternalStoreHandle<T>
impl<T> UnwindSafe for InternalStoreHandle<T>
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
source§impl<T> CloneToUninit for Twhere
T: Copy,
impl<T> CloneToUninit for Twhere
T: Copy,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.§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.