pub trait ToOwnedIn<A: Allocator> {
type Owned: Borrow<Self>;
// Required method
fn try_to_owned_in<I>(
&self,
alloc_in: I,
) -> Result<Self::Owned, StorageError>
where I: AllocateIn<Alloc = A>;
// Provided method
fn to_owned_in<I>(&self, alloc_in: I) -> Self::Owned
where I: AllocateIn<Alloc = A> { ... }
}
Expand description
Support conversion from borrowed types to owned ones associated with an allocator.
Required Associated Types§
Required Methods§
Sourcefn try_to_owned_in<I>(&self, alloc_in: I) -> Result<Self::Owned, StorageError>where
I: AllocateIn<Alloc = A>,
fn try_to_owned_in<I>(&self, alloc_in: I) -> Result<Self::Owned, StorageError>where
I: AllocateIn<Alloc = A>,
To to create an owned copy of this instance in a given allocation target.
Provided Methods§
Sourcefn to_owned_in<I>(&self, alloc_in: I) -> Self::Ownedwhere
I: AllocateIn<Alloc = A>,
fn to_owned_in<I>(&self, alloc_in: I) -> Self::Ownedwhere
I: AllocateIn<Alloc = A>,
Create an owned copy of this instance in a given allocation target.
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.