Trait noodles_core::position::SequenceIndex

source ·
pub trait SequenceIndex<T> {
    type Output: ?Sized;

    // Required methods
    fn get(self, sequence: &[T]) -> Option<&Self::Output>;
    fn get_mut(self, sequence: &mut [T]) -> Option<&mut Self::Output>;
    fn index(self, sequence: &[T]) -> &Self::Output;
    fn index_mut(self, sequence: &mut [T]) -> &mut Self::Output;
}
Expand description

A 1-based index for sequences.

Required Associated Types§

source

type Output: ?Sized

The output returned.

Required Methods§

source

fn get(self, sequence: &[T]) -> Option<&Self::Output>

Returns a reference to the output of the given index.

source

fn get_mut(self, sequence: &mut [T]) -> Option<&mut Self::Output>

Returns a mutable reference to the output of the given index.

source

fn index(self, sequence: &[T]) -> &Self::Output

Returns a reference to the output of the given index.

This panics if the index is out of bounds.

source

fn index_mut(self, sequence: &mut [T]) -> &mut Self::Output

Returns a mutable reference to the output of the given index.

This panics if the index is out of bounds.

Implementations on Foreign Types§

source§

impl<T> SequenceIndex<T> for Range<Position>

§

type Output = [T]

source§

fn get(self, sequence: &[T]) -> Option<&Self::Output>

source§

fn get_mut(self, sequence: &mut [T]) -> Option<&mut Self::Output>

source§

fn index(self, sequence: &[T]) -> &Self::Output

source§

fn index_mut(self, sequence: &mut [T]) -> &mut Self::Output

source§

impl<T> SequenceIndex<T> for RangeFrom<Position>

§

type Output = [T]

source§

fn get(self, sequence: &[T]) -> Option<&Self::Output>

source§

fn get_mut(self, sequence: &mut [T]) -> Option<&mut Self::Output>

source§

fn index(self, sequence: &[T]) -> &Self::Output

source§

fn index_mut(self, sequence: &mut [T]) -> &mut Self::Output

source§

impl<T> SequenceIndex<T> for RangeFull

§

type Output = [T]

source§

fn get(self, sequence: &[T]) -> Option<&Self::Output>

source§

fn get_mut(self, sequence: &mut [T]) -> Option<&mut Self::Output>

source§

fn index(self, sequence: &[T]) -> &Self::Output

source§

fn index_mut(self, sequence: &mut [T]) -> &mut Self::Output

source§

impl<T> SequenceIndex<T> for RangeInclusive<Position>

§

type Output = [T]

source§

fn get(self, sequence: &[T]) -> Option<&Self::Output>

source§

fn get_mut(self, sequence: &mut [T]) -> Option<&mut Self::Output>

source§

fn index(self, sequence: &[T]) -> &Self::Output

source§

fn index_mut(self, sequence: &mut [T]) -> &mut Self::Output

source§

impl<T> SequenceIndex<T> for RangeTo<Position>

§

type Output = [T]

source§

fn get(self, sequence: &[T]) -> Option<&Self::Output>

source§

fn get_mut(self, sequence: &mut [T]) -> Option<&mut Self::Output>

source§

fn index(self, sequence: &[T]) -> &Self::Output

source§

fn index_mut(self, sequence: &mut [T]) -> &mut Self::Output

source§

impl<T> SequenceIndex<T> for RangeToInclusive<Position>

§

type Output = [T]

source§

fn get(self, sequence: &[T]) -> Option<&Self::Output>

source§

fn get_mut(self, sequence: &mut [T]) -> Option<&mut Self::Output>

source§

fn index(self, sequence: &[T]) -> &Self::Output

source§

fn index_mut(self, sequence: &mut [T]) -> &mut Self::Output

Implementors§

source§

impl<T> SequenceIndex<T> for Position

§

type Output = T