Trait flex_alloc::borrow::ToOwnedIn

source ·
pub trait ToOwnedIn<A: RawAlloc> {
    type Owned: Borrow<Self>;

    // Required method
    fn try_to_owned_in<I>(
        &self,
        alloc_in: I,
    ) -> Result<Self::Owned, StorageError>
       where I: RawAllocIn<RawAlloc = A>;

    // Provided method
    fn to_owned_in<I>(&self, alloc_in: I) -> Self::Owned
       where I: RawAllocIn<RawAlloc = A> { ... }
}

Required Associated Types§

source

type Owned: Borrow<Self>

Required Methods§

source

fn try_to_owned_in<I>(&self, alloc_in: I) -> Result<Self::Owned, StorageError>
where I: RawAllocIn<RawAlloc = A>,

Provided Methods§

source

fn to_owned_in<I>(&self, alloc_in: I) -> Self::Owned
where I: RawAllocIn<RawAlloc = A>,

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl<T: Clone, A: RawAlloc> ToOwnedIn<A> for [T]

source§

type Owned = Vec<T, A>

source§

fn try_to_owned_in<I>(&self, alloc_in: I) -> Result<Self::Owned, StorageError>
where I: RawAllocIn<RawAlloc = A>,

Implementors§

source§

impl<T: Clone + 'static, A: RawAlloc> ToOwnedIn<A> for T

source§

type Owned = T