Skip to main content

SlotMap

Struct SlotMap 

Source
pub struct SlotMap<V: CustomStruct> { /* private fields */ }

Implementations§

Source§

impl<V: CustomStruct> SlotMap<V>

Source

pub fn add( &mut self, diff: &mut DiffSerializer<impl AnyTradeOff>, ) -> (usize32, &mut V)

Source

pub fn remove( &mut self, id: usize32, diff: &mut DiffSerializer<impl AnyTradeOff>, ) -> Option<()>

Source

pub fn clear(&mut self, diff: &mut DiffSerializer<impl AnyTradeOff>) -> usize32

Source

pub fn get_mut(&mut self, id: usize32) -> Option<&mut V>

Source

pub fn iter_mut( &mut self, ) -> impl ExactSizeIterator<Item = (usize32, &mut V)> + DoubleEndedIterator + FusedIterator

Source

pub fn values_mut( &mut self, ) -> impl ExactSizeIterator<Item = &mut V> + DoubleEndedIterator + FusedIterator

Methods from Deref<Target = RawSlotMap<V>>§

Source

pub fn has(&self, id: usize32) -> bool

Source

pub fn get(&self, id: usize32) -> Option<&V>

Source

pub fn len(&self) -> usize32

Source

pub fn is_empty(&self) -> bool

Source

pub fn iter( &self, ) -> impl ExactSizeIterator<Item = (usize32, &V)> + DoubleEndedIterator + FusedIterator + Clone

Source

pub fn ids( &self, ) -> impl ExactSizeIterator<Item = usize32> + DoubleEndedIterator + FusedIterator + Clone

Source

pub fn values( &self, ) -> impl ExactSizeIterator<Item = &V> + DoubleEndedIterator + FusedIterator + Clone

Trait Implementations§

Source§

impl<V: CustomStruct> ConstructPlugin for SlotMap<V>

Source§

fn construct(path: &Rc<[usize32]>, field_id: usize32) -> Self

Source§

impl<V: Debug + CustomStruct> Debug for SlotMap<V>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<V: CustomStruct> Deref for SlotMap<V>

Source§

type Target = RawSlotMap<V>

The resulting type after dereferencing.
Source§

fn deref(&self) -> &Self::Target

Dereferences the value.
Source§

impl<V: CustomStruct> DiffDeserializePlugin for SlotMap<V>

Source§

fn navigate_down( &mut self, element_id: usize32, ) -> Option<&mut dyn DiffDeserializeCustomStruct>

Source§

fn des_rollback( &mut self, diff_op: u8, buffer: &mut Vec<u8>, ) -> Result<(), DeserializeOopsy>

Source§

impl<V: CustomStruct> SnapshotState for SlotMap<V>

Source§

fn ser_rollback_predict_remove(&self, buffer: &mut Vec<u8>)

Source§

fn des_rollback_predict_remove( &mut self, buffer: &mut Vec<u8>, ) -> Result<(), DeserializeOopsy>

Source§

impl<V: CustomStruct> UntrackedState for SlotMap<V>

Auto Trait Implementations§

§

impl<V> !Send for SlotMap<V>

§

impl<V> !Sync for SlotMap<V>

§

impl<V> Freeze for SlotMap<V>
where RawSlotMap<V>: Freeze,

§

impl<V> RefUnwindSafe for SlotMap<V>

§

impl<V> Unpin for SlotMap<V>
where RawSlotMap<V>: Unpin,

§

impl<V> UnsafeUnpin for SlotMap<V>

§

impl<V> UnwindSafe for SlotMap<V>

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<P, T> Receiver for P
where P: Deref<Target = T> + ?Sized, T: ?Sized,

Source§

type Target = T

🔬This is a nightly-only experimental API. (arbitrary_self_types)
The target type on which the method may be called.
Source§

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

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

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.