[][src]Struct one_way_slot_map::SlotMap

pub struct SlotMap<K, P, T> where
    K: SlotMapKey<P>, 
{ /* fields omitted */ }

Simple and naive map that keeps elements in slots that can be accessed by id and that id is guaranteed not to change over time

Implementations

impl<K, P, T> SlotMap<K, P, T> where
    K: SlotMapKey<P>, 
[src]

pub fn new() -> SlotMap<K, P, T>[src]

Create a new default simple slot map

pub fn len(&self) -> usize[src]

pub fn insert(&mut self, pointer: P, value: T) -> K[src]

insert the given item into the slot map and return its key

pub fn get(&self, key: &K) -> Option<&T>[src]

Get the value for the given key if there is one

pub fn get_mut(&mut self, key: &K) -> Option<&mut T>[src]

Get the value for the given key if there is one

pub fn remove(&mut self, key: &K) -> Option<&mut T>[src]

Remove the item at the given index and return true iff successful

Auto Trait Implementations

impl<K, P, T> RefUnwindSafe for SlotMap<K, P, T> where
    K: RefUnwindSafe,
    P: RefUnwindSafe,
    T: RefUnwindSafe

impl<K, P, T> Send for SlotMap<K, P, T> where
    K: Send,
    P: Send,
    T: Send

impl<K, P, T> Sync for SlotMap<K, P, T> where
    K: Sync,
    P: Sync,
    T: Sync

impl<K, P, T> Unpin for SlotMap<K, P, T> where
    K: Unpin,
    P: Unpin

impl<K, P, T> UnwindSafe for SlotMap<K, P, T> where
    K: UnwindSafe,
    P: UnwindSafe,
    T: UnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.