pub struct Table<T> { /* private fields */ }
Implementations§
Source§impl<T> Table<T>
impl<T> Table<T>
Sourcepub fn insert(&mut self, item: T) -> u32
pub fn insert(&mut self, item: T) -> u32
Inserts an item into this table, returning the index that it was inserted at.
Sourcepub fn get(&self, item: u32) -> Option<&T>
pub fn get(&self, item: u32) -> Option<&T>
Borrows an item from this table.
Returns None
if the index is not allocated at this time. Otherwise
returns Some
with a borrow of the item from this table.
Sourcepub fn remove(&mut self, item: u32) -> Result<T, RemoveError>
pub fn remove(&mut self, item: u32) -> Result<T, RemoveError>
Removes an item from this table.
On success it returns back the original item.
Trait Implementations§
Auto Trait Implementations§
impl<T> Freeze for Table<T>
impl<T> RefUnwindSafe for Table<T>where
T: RefUnwindSafe,
impl<T> Send for Table<T>where
T: Send,
impl<T> Sync for Table<T>where
T: Sync,
impl<T> Unpin for Table<T>
impl<T> UnwindSafe for Table<T>where
T: UnwindSafe,
Blanket Implementations§
Source§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
Source§type ArchivedMetadata = ()
type ArchivedMetadata = ()
The archived version of the pointer metadata for this type.
Source§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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> LayoutRaw for T
impl<T> LayoutRaw for T
Source§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.
Source§impl<T> Upcastable for T
impl<T> Upcastable for T
Source§fn upcast_any_ref(&self) -> &(dyn Any + 'static)
fn upcast_any_ref(&self) -> &(dyn Any + 'static)
upcast ref
Source§fn upcast_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn upcast_any_mut(&mut self) -> &mut (dyn Any + 'static)
upcast mut ref