Skip to main content

ConvertAlloc

Trait ConvertAlloc 

Source
pub trait ConvertAlloc<Target> {
    // Required method
    fn convert(self) -> Target;
}
Expand description

Convert between types in this crate and standard containers.

Required Methods§

Source

fn convert(self) -> Target

Convert directly into the target type, ideally without reallocating.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementations on Foreign Types§

Source§

impl<T, C> ConvertAlloc<Vec<T, C>> for Box<[T]>
where C: VecConfigAlloc<T, Alloc = Global>,

Available on crate feature alloc and non-crate feature nightly only.
Source§

fn convert(self) -> Vec<T, C>

Source§

impl<T, C> ConvertAlloc<Vec<T, C>> for Vec<T>
where C: VecConfigAlloc<T, Alloc = Global, Index = usize>,

Available on crate feature alloc and non-crate feature nightly only.
Source§

fn convert(self) -> Vec<T, C>

Source§

impl<T: ?Sized> ConvertAlloc<Box<T>> for Box<T>

Available on crate feature alloc and non-crate feature nightly only.
Source§

fn convert(self) -> Box<T, Global>

Implementors§

Source§

impl<T, C> ConvertAlloc<Box<[T]>> for flex_alloc::vec::Vec<T, C>
where C: VecConfigAlloc<T, Alloc = Global>,

Available on crate feature alloc and non-crate feature nightly only.
Source§

impl<T, C> ConvertAlloc<Vec<T>> for flex_alloc::vec::Vec<T, C>
where C: VecConfigAlloc<T, Alloc = Global, Index = usize>,

Available on crate feature alloc and non-crate feature nightly only.
Source§

impl<T: ?Sized> ConvertAlloc<Box<T>> for flex_alloc::boxed::Box<T, Global>

Available on crate feature alloc and non-crate feature nightly only.