pub struct PokeMap<'mem> { /* private fields */ }Expand description
Allows poking a map (inserting, etc.)
Implementations§
Source§impl<'mem> PokeMap<'mem>
impl<'mem> PokeMap<'mem>
Sourcepub fn map_vtable(&self) -> &'static MapVTable
pub fn map_vtable(&self) -> &'static MapVTable
Gets the vtable for the map
Sourcepub unsafe fn insert(&mut self, key: Opaque<'_>, value: Opaque<'_>)
pub unsafe fn insert(&mut self, key: Opaque<'_>, value: Opaque<'_>)
Inserts a key-value pair into the map
§Safety
key and value are moved out of (with core::ptr::read) — they should be deallocated
afterwards but NOT dropped.
Sourcepub fn contains_key(&self, key: OpaqueConst<'_>) -> bool
pub fn contains_key(&self, key: OpaqueConst<'_>) -> bool
Checks if the map contains a key
Sourcepub fn get_value_ptr<'key>(
&self,
key: OpaqueConst<'key>,
) -> Option<OpaqueConst<'mem>>
pub fn get_value_ptr<'key>( &self, key: OpaqueConst<'key>, ) -> Option<OpaqueConst<'mem>>
Gets a pointer to the value for a given key
Returns None if the key is not found.
Sourcepub fn build_in_place(self) -> Opaque<'mem>
pub fn build_in_place(self) -> Opaque<'mem>
Takes ownership of this PokeList and returns the underlying data.
Auto Trait Implementations§
impl<'mem> Freeze for PokeMap<'mem>
impl<'mem> RefUnwindSafe for PokeMap<'mem>
impl<'mem> !Send for PokeMap<'mem>
impl<'mem> !Sync for PokeMap<'mem>
impl<'mem> Unpin for PokeMap<'mem>
impl<'mem> !UnwindSafe for PokeMap<'mem>
Blanket Implementations§
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