Trait AsSlice

Source
pub trait AsSlice<T> {
    // Required method
    fn as_slice(&self) -> &[T];
}
Expand description

AsSlice is a generic trait for converting a type into a slice of its elements. This is useful for types that can be represented as a contiguous sequence of elements, such as arrays, vectors, or other collections.

Required Methods§

Source

fn as_slice(&self) -> &[T]

Implementors§

Source§

impl<S, T> AsSlice<T> for S
where S: AsRef<[T]>,