Trait alloc::borrow::ToOwned 1.0.0[−][src]
pub trait ToOwned { type Owned: Borrow<Self>; #[must_use = "cloning is often expensive and is not expected to have side effects"] fn to_owned(&self) -> Self::Owned; fn clone_into(&self, target: &mut Self::Owned) { ... } }
Expand description
Clone
到借用数据的一般化。
某些类型通常可以通过实现 Clone
trait 从借用变为拥有。
但是 Clone
仅适用于从 &T
到 T
的情况。
ToOwned
trait 泛化 Clone
来构造给定类型的任何借用数据。
Associated Types
Required methods
Provided methods
fn clone_into(&self, target: &mut Self::Owned)
[src]
fn clone_into(&self, target: &mut Self::Owned)
[src]🔬 This is a nightly-only experimental API. (toowned_clone_into
#41263)
recently added