Skip to main content

IndexExtension

Trait IndexExtension 

Source
pub trait IndexExtension<C>: Sized {
    // Provided methods
    fn get(self, collection: &C) -> Option<&<C as Get<Self>>::Output>
       where C: Get<Self>,
             <C as Get<Self>>::Output: Sized { ... }
    unsafe fn get_unchecked(self, collection: &C) -> &<C as Get<Self>>::Output
       where C: Get<Self>,
             <C as Get<Self>>::Output: Sized { ... }
    fn get_mut(self, collection: &mut C) -> Option<&<C as Get<Self>>::Output>
       where C: GetMut<Self>,
             <C as Get<Self>>::Output: Sized { ... }
    unsafe fn get_unchecked_mut(
        self,
        collection: &mut C,
    ) -> &mut <C as Get<Self>>::Output
       where C: GetMut<Self>,
             <C as Get<Self>>::Output: Sized { ... }
    fn is_valid(self, collection: &C) -> bool
       where C: Get<Self>,
             <C as Get<Self>>::Output: Sized { ... }
    fn is_invalid(self, collection: &C) -> bool
       where C: Get<Self>,
             <C as Get<Self>>::Output: Sized { ... }
    fn remove(self, collection: &mut C) -> Option<<C as Remove<Self>>::Output>
       where C: Remove<Self> { ... }
}

Provided Methods§

Source

fn get(self, collection: &C) -> Option<&<C as Get<Self>>::Output>
where C: Get<Self>, <C as Get<Self>>::Output: Sized,

Source

unsafe fn get_unchecked(self, collection: &C) -> &<C as Get<Self>>::Output
where C: Get<Self>, <C as Get<Self>>::Output: Sized,

Source

fn get_mut(self, collection: &mut C) -> Option<&<C as Get<Self>>::Output>
where C: GetMut<Self>, <C as Get<Self>>::Output: Sized,

Source

unsafe fn get_unchecked_mut( self, collection: &mut C, ) -> &mut <C as Get<Self>>::Output
where C: GetMut<Self>, <C as Get<Self>>::Output: Sized,

Source

fn is_valid(self, collection: &C) -> bool
where C: Get<Self>, <C as Get<Self>>::Output: Sized,

Source

fn is_invalid(self, collection: &C) -> bool
where C: Get<Self>, <C as Get<Self>>::Output: Sized,

Source

fn remove(self, collection: &mut C) -> Option<<C as Remove<Self>>::Output>
where C: Remove<Self>,

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl<Gen, C> IndexExtension<C> for UntypedGenIDOf<Gen>
where Gen: IGeneration,

Source§

impl<I, T> IndexExtension<T> for I
where I: SliceIndex<T>,

Source§

impl<T, Gen, C> IndexExtension<C> for GenIDOf<T, Gen>
where Gen: IGeneration,