pub trait TryToOwned {
type Owned: Borrow<Self>;
// Required method
fn try_to_owned(&self) -> Result<Self::Owned, OutOfMemory>;
}Expand description
Like [std::borrow::ToOwned] but returns an OutOfMemory error on
allocation failure.
Required Associated Types§
Required Methods§
Sourcefn try_to_owned(&self) -> Result<Self::Owned, OutOfMemory>
fn try_to_owned(&self) -> Result<Self::Owned, OutOfMemory>
Try to allocate an owned version of self.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".