RcSlice1Ext

Trait RcSlice1Ext 

Source
pub trait RcSlice1Ext<T>: Sized {
    // Required methods
    unsafe fn from_rc_slice_unchecked(items: Rc<[T]>) -> Self;
    fn try_from_rc_slice(items: Rc<[T]>) -> Result<Self, EmptyError<Rc<[T]>>>;
    fn from_array1<const N: usize>(items: [T; N]) -> Self
       where [T; N]: Array1;
    fn from_boxed_slice1(items: BoxedSlice1<T>) -> Self;
    fn from_cow_slice1(items: CowSlice1<'_, T>) -> Self
       where T: Clone;
    fn try_into_rc_array<const N: usize>(self) -> Result<Rc<[T; N]>, Self>;
    fn into_rc_slice(self) -> Rc<[T]>;
    fn as_slice1(&self) -> &Slice1<T>;
}
Available on crate feature alloc only.

Required Methods§

Source

unsafe fn from_rc_slice_unchecked(items: Rc<[T]>) -> Self

§Safety

items must be non-empty. For example, it is unsound to call this function with Rc::<T>::from([]).

Source

fn try_from_rc_slice(items: Rc<[T]>) -> Result<Self, EmptyError<Rc<[T]>>>

Source

fn from_array1<const N: usize>(items: [T; N]) -> Self
where [T; N]: Array1,

Source

fn from_boxed_slice1(items: BoxedSlice1<T>) -> Self

Source

fn from_cow_slice1(items: CowSlice1<'_, T>) -> Self
where T: Clone,

Source

fn try_into_rc_array<const N: usize>(self) -> Result<Rc<[T; N]>, Self>

Source

fn into_rc_slice(self) -> Rc<[T]>

Source

fn as_slice1(&self) -> &Slice1<T>

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.

Implementors§

Source§

impl<T> RcSlice1Ext<T> for RcSlice1<T>