pub trait TryClone: Sized {
// Required method
fn try_clone(&self) -> Result<Self, Error>;
// Provided method
fn try_clone_from(&mut self, source: &Self) -> Result<(), Error> { ... }
}Expand description
Fallible TryClone trait.
Required Methods§
Provided Methods§
Sourcefn try_clone_from(&mut self, source: &Self) -> Result<(), Error>
fn try_clone_from(&mut self, source: &Self) -> Result<(), Error>
Performs copy-assignment from source.
a.try_clone_from(&b) is equivalent to a = b.clone() in
functionality, but can be overridden to reuse the resources of a to
avoid unnecessary allocations.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".
Implementations on Foreign Types§
Source§impl<A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P> TryClone for (A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P)
impl<A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P> TryClone for (A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P)
Source§impl<A, B, C, D, E, F, G, H, I, J, K, L, M, N, O> TryClone for (A, B, C, D, E, F, G, H, I, J, K, L, M, N, O)
impl<A, B, C, D, E, F, G, H, I, J, K, L, M, N, O> TryClone for (A, B, C, D, E, F, G, H, I, J, K, L, M, N, O)
Source§impl<A, B, C, D, E, F, G, H, I, J, K, L, M, N> TryClone for (A, B, C, D, E, F, G, H, I, J, K, L, M, N)
impl<A, B, C, D, E, F, G, H, I, J, K, L, M, N> TryClone for (A, B, C, D, E, F, G, H, I, J, K, L, M, N)
Source§impl<A, B, C, D, E, F, G, H, I, J, K, L, M> TryClone for (A, B, C, D, E, F, G, H, I, J, K, L, M)
impl<A, B, C, D, E, F, G, H, I, J, K, L, M> TryClone for (A, B, C, D, E, F, G, H, I, J, K, L, M)
Source§impl<A, B, C, D, E, F, G, H, I, J, K, L> TryClone for (A, B, C, D, E, F, G, H, I, J, K, L)
impl<A, B, C, D, E, F, G, H, I, J, K, L> TryClone for (A, B, C, D, E, F, G, H, I, J, K, L)
Source§impl<A, B, C, D, E, F, G, H, I, J, K> TryClone for (A, B, C, D, E, F, G, H, I, J, K)
impl<A, B, C, D, E, F, G, H, I, J, K> TryClone for (A, B, C, D, E, F, G, H, I, J, K)
Source§impl<A, B, C, D, E, F, G, H, I, J> TryClone for (A, B, C, D, E, F, G, H, I, J)
impl<A, B, C, D, E, F, G, H, I, J> TryClone for (A, B, C, D, E, F, G, H, I, J)
Source§impl<A, B, C, D, E, F, G, H, I> TryClone for (A, B, C, D, E, F, G, H, I)
impl<A, B, C, D, E, F, G, H, I> TryClone for (A, B, C, D, E, F, G, H, I)
Source§impl<A, B, C, D, E, F, G, H> TryClone for (A, B, C, D, E, F, G, H)
impl<A, B, C, D, E, F, G, H> TryClone for (A, B, C, D, E, F, G, H)
Source§impl<A, B, C, D, E, F, G> TryClone for (A, B, C, D, E, F, G)
impl<A, B, C, D, E, F, G> TryClone for (A, B, C, D, E, F, G)
Source§impl<A, B, C, D, E, F> TryClone for (A, B, C, D, E, F)
impl<A, B, C, D, E, F> TryClone for (A, B, C, D, E, F)
Source§impl<A, B, C, D, E> TryClone for (A, B, C, D, E)
impl<A, B, C, D, E> TryClone for (A, B, C, D, E)
Source§impl<A, B, C, D> TryClone for (A, B, C, D)
impl<A, B, C, D> TryClone for (A, B, C, D)
Implementors§
impl TryClone for Cow<'_, str>
impl<A> TryClone for rune_alloc::Box<Path, A>
Available on crate feature
std only.