Trait AsSequence

Source
pub trait AsSequence {
    type Item;
    type Sequence<'a>: Sequence<Item = &'a Self::Item>
       where Self: 'a,
             Self::Item: 'a;

    // Required method
    fn as_sequence(&self) -> Self::Sequence<'_>;
}
Expand description

Allowed borrowing self as a sequence of values owned by self.

Required Associated Types§

Source

type Item

Source

type Sequence<'a>: Sequence<Item = &'a Self::Item> where Self: 'a, Self::Item: 'a

Required Methods§

Source

fn as_sequence(&self) -> Self::Sequence<'_>

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, const N: usize> AsSequence for [T; N]

Source§

type Item = T

Source§

type Sequence<'a> = BorrowedIterSeq<Iter<'a, T>, [T; N]> where T: 'a

Source§

fn as_sequence(&self) -> Self::Sequence<'_>

Implementors§