Trait SoaIndex

Source
pub trait SoaIndex<T>
where T: Soars,
{ type Output<'a> where T: 'a; type OutputMut<'a> where T: 'a; // Required methods fn get(self, slice: &Slice<T>) -> Option<Self::Output<'_>>; fn get_mut(self, slice: &mut Slice<T>) -> Option<Self::OutputMut<'_>>; }
Expand description

A helper trait for indexing operations.

Required Associated Types§

Source

type Output<'a> where T: 'a

The output type returned by non-mut methods.

Source

type OutputMut<'a> where T: 'a

The output type returned by mut methods.

Required Methods§

Source

fn get(self, slice: &Slice<T>) -> Option<Self::Output<'_>>

Returns the output at this location, if in bounds.

Source

fn get_mut(self, slice: &mut Slice<T>) -> Option<Self::OutputMut<'_>>

Returns the mutable output at this location, if in bounds.

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.

Implementations on Foreign Types§

Source§

impl<T> SoaIndex<T> for usize
where T: Soars,

Source§

type Output<'a> = <T as Soars>::Ref<'a> where T: 'a

Source§

type OutputMut<'a> = <T as Soars>::RefMut<'a> where T: 'a

Source§

fn get(self, slice: &Slice<T>) -> Option<Self::Output<'_>>

Source§

fn get_mut(self, slice: &mut Slice<T>) -> Option<Self::OutputMut<'_>>

Source§

impl<T> SoaIndex<T> for Range<usize>
where T: Soars,

Source§

type Output<'a> = SliceRef<'a, T> where T: 'a

Source§

type OutputMut<'a> = SliceMut<'a, T> where T: 'a

Source§

fn get(self, slice: &Slice<T>) -> Option<Self::Output<'_>>

Source§

fn get_mut(self, slice: &mut Slice<T>) -> Option<Self::OutputMut<'_>>

Source§

impl<T> SoaIndex<T> for RangeFrom<usize>
where T: Soars,

Source§

type Output<'a> = SliceRef<'a, T> where T: 'a

Source§

type OutputMut<'a> = SliceMut<'a, T> where T: 'a

Source§

fn get(self, slice: &Slice<T>) -> Option<Self::Output<'_>>

Source§

fn get_mut(self, slice: &mut Slice<T>) -> Option<Self::OutputMut<'_>>

Source§

impl<T> SoaIndex<T> for RangeFull
where T: Soars,

Source§

type Output<'a> = SliceRef<'a, T> where T: 'a

Source§

type OutputMut<'a> = SliceMut<'a, T> where T: 'a

Source§

fn get(self, slice: &Slice<T>) -> Option<Self::Output<'_>>

Source§

fn get_mut(self, slice: &mut Slice<T>) -> Option<Self::OutputMut<'_>>

Source§

impl<T> SoaIndex<T> for RangeInclusive<usize>
where T: Soars,

Source§

type Output<'a> = SliceRef<'a, T> where T: 'a

Source§

type OutputMut<'a> = SliceMut<'a, T> where T: 'a

Source§

fn get(self, slice: &Slice<T>) -> Option<Self::Output<'_>>

Source§

fn get_mut(self, slice: &mut Slice<T>) -> Option<Self::OutputMut<'_>>

Source§

impl<T> SoaIndex<T> for RangeTo<usize>
where T: Soars,

Source§

type Output<'a> = SliceRef<'a, T> where T: 'a

Source§

type OutputMut<'a> = SliceMut<'a, T> where T: 'a

Source§

fn get(self, slice: &Slice<T>) -> Option<Self::Output<'_>>

Source§

fn get_mut(self, slice: &mut Slice<T>) -> Option<Self::OutputMut<'_>>

Source§

impl<T> SoaIndex<T> for RangeToInclusive<usize>
where T: Soars,

Source§

type Output<'a> = SliceRef<'a, T> where T: 'a

Source§

type OutputMut<'a> = SliceMut<'a, T> where T: 'a

Source§

fn get(self, slice: &Slice<T>) -> Option<Self::Output<'_>>

Source§

fn get_mut(self, slice: &mut Slice<T>) -> Option<Self::OutputMut<'_>>

Implementors§