pub trait IntoOwned {
// Required method
fn into_owned(self) -> Self;
}
Expand description
Into owned.
Note the difference between this and ToOwned: here self
is moved rather than referenced.
This allows implementations to avoid allocation when unnecessary. For example, if we are
already owned then we can return self
.
Required Methods§
Sourcefn into_owned(self) -> Self
fn into_owned(self) -> Self
Into owned.
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.