Skip to main content

ListIndex

Trait ListIndex 

Source
pub trait ListIndex<Idx: ?Sized> {
    type Output;

    // Required method
    fn index(&self, index: Idx) -> &Self::Output;
}
Expand description

Indexing for lists using typenum-based indices and ranges.

Required Associated Types§

Source

type Output

The output reference type when indexing with Idx.

Required Methods§

Source

fn index(&self, index: Idx) -> &Self::Output

Return a reference to the element or sublist selected by index.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl ListIndex<RangeFrom<UTerm>> for ()

Source§

type Output = ()

Source§

fn index(&self, _index: RangeFrom<U0>) -> &Self::Output

Source§

impl<H: 'static, T, U: Unsigned, B: Bit> ListIndex<RangeFrom<UInt<U, B>>> for (H, T)
where T: ListIndex<RangeFrom<Sub1<UInt<U, B>>>> + List, UInt<U, B>: Sub<B1>,

Source§

type Output = <T as ListIndex<RangeFrom<<UInt<U, B> as Sub<B1>>::Output>>>::Output

Source§

fn index(&self, index: RangeFrom<UInt<U, B>>) -> &Self::Output

Source§

impl<H: 'static, T, U: Unsigned, B: Bit> ListIndex<UInt<U, B>> for (H, T)
where T: ListIndex<Sub1<UInt<U, B>>> + List, UInt<U, B>: Sub<B1>,

Source§

type Output = <T as ListIndex<<UInt<U, B> as Sub<B1>>::Output>>::Output

Source§

fn index(&self, index: UInt<U, B>) -> &Self::Output

Source§

impl<H: 'static, T: List> ListIndex<RangeFrom<UTerm>> for (H, T)

Source§

type Output = (H, T)

Source§

fn index(&self, _index: RangeFrom<U0>) -> &Self::Output

Source§

impl<H: 'static, T: List> ListIndex<UTerm> for (H, T)

Source§

type Output = H

Source§

fn index(&self, _index: U0) -> &Self::Output

Implementors§

Source§

impl<H: 'static, T, U: Unsigned, B: Bit> ListIndex<RangeFrom<UInt<U, B>>> for CStackList<H, T>
where T: ListIndex<RangeFrom<Sub1<UInt<U, B>>>> + List + CStackListHeadLimit, UInt<U, B>: Sub<B1>,

Source§

type Output = <T as ListIndex<RangeFrom<<UInt<U, B> as Sub<B1>>::Output>>>::Output

Source§

impl<H: 'static, T, U: Unsigned, B: Bit> ListIndex<RangeTo<UInt<U, B>>> for CStackList<H, T>
where T: ListIndex<RangeTo<Sub1<UInt<U, B>>>> + List + CStackListHeadLimit, <T as ListIndex<RangeTo<Sub1<UInt<U, B>>>>>::Output: List, UInt<U, B>: Sub<B1>,

Source§

type Output = <<T as ListIndex<RangeTo<<UInt<U, B> as Sub<B1>>::Output>>>::Output as List>::Push<H>

Source§

impl<H: 'static, T, U: Unsigned, B: Bit> ListIndex<RangeToInclusive<UInt<U, B>>> for CStackList<H, T>

Source§

type Output = <<T as ListIndex<RangeToInclusive<<UInt<U, B> as Sub<B1>>::Output>>>::Output as List>::Push<H>

Source§

impl<H: 'static, T, U: Unsigned, B: Bit> ListIndex<UInt<U, B>> for CStackList<H, T>
where T: ListIndex<Sub1<UInt<U, B>>> + List + CStackListHeadLimit, UInt<U, B>: Sub<B1>,

Source§

type Output = <T as ListIndex<<UInt<U, B> as Sub<B1>>::Output>>::Output

Source§

impl<H: 'static, T: List + CStackListHeadLimit> ListIndex<RangeFrom<UTerm>> for CStackList<H, T>

Source§

impl<H: 'static, T: List + CStackListHeadLimit> ListIndex<RangeTo<UTerm>> for CStackList<H, T>

Source§

impl<H: 'static, T: List + CStackListHeadLimit> ListIndex<RangeToInclusive<UTerm>> for CStackList<H, T>

Source§

impl<H: 'static, T: List + CStackListHeadLimit> ListIndex<UTerm> for CStackList<H, T>