Trait AsSlice

Source
pub trait AsSlice {
    type Item: Sized;

    // Required methods
    const fn as_slice(&self) -> &[Self::Item];
    const fn as_mut_slice(&mut self) -> &mut [Self::Item];
}
Expand description

A trait for obtaining a slice [Self::Item]

Required Associated Types§

Required Methods§

Source

const fn as_slice(&self) -> &[Self::Item]

Yields slice from generic

Source

const fn as_mut_slice(&mut self) -> &mut [Self::Item]

Yields mutable slice from generic

Implementations on Foreign Types§

Source§

impl<T> AsSlice for [T]

Source§

type Item = T

Source§

const fn as_slice(&self) -> &[Self::Item]

Source§

const fn as_mut_slice(&mut self) -> &mut [Self::Item]

Source§

impl<T> AsSlice for Box<[T]>

Source§

type Item = T

Source§

const fn as_slice(&self) -> &[Self::Item]

Source§

const fn as_mut_slice(&mut self) -> &mut [Self::Item]

Implementors§