Struct PokeMap

Source
pub struct PokeMap<'mem> { /* private fields */ }
Expand description

Allows poking a map (inserting, etc.)

Implementations§

Source§

impl<'mem> PokeMap<'mem>

Source

pub fn shape(&self) -> &'static Shape

Get the shape of the map

Source

pub fn map_vtable(&self) -> &'static MapVTable

Gets the vtable for the map

Source

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.

Source

pub fn len(&self) -> usize

Gets the number of entries in the map

Source

pub fn is_empty(&self) -> bool

Checks if the map contains no entries

Source

pub fn contains_key(&self, key: OpaqueConst<'_>) -> bool

Checks if the map contains a key

Source

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.

Source

pub fn build_in_place(self) -> Opaque<'mem>

Takes ownership of this PokeList and returns the underlying data.

Source

pub fn def(&self) -> &MapDef

Returns a reference to the MapDef of this PokeMap.

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> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.