Trait soa_rs::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.

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

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

§

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

§

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,

§

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

§

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,

§

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

§

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,

§

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

§

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,

§

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

§

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,

§

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

§

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,

§

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

§

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§