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§

source

fn try_clone(&self) -> Result<Self, Error>

Try to clone the current value, raising an allocation error if it’s unsuccessful.

Provided Methods§

source

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.

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl TryClone for bool

source§

fn try_clone(&self) -> Result<Self, Error>

source§

impl TryClone for char

source§

fn try_clone(&self) -> Result<Self, Error>

source§

impl TryClone for f32

source§

fn try_clone(&self) -> Result<Self, Error>

source§

impl TryClone for f64

source§

fn try_clone(&self) -> Result<Self, Error>

source§

impl TryClone for i8

source§

fn try_clone(&self) -> Result<Self, Error>

source§

impl TryClone for i16

source§

fn try_clone(&self) -> Result<Self, Error>

source§

impl TryClone for i32

source§

fn try_clone(&self) -> Result<Self, Error>

source§

impl TryClone for i64

source§

fn try_clone(&self) -> Result<Self, Error>

source§

impl TryClone for i128

source§

fn try_clone(&self) -> Result<Self, Error>

source§

impl TryClone for isize

source§

fn try_clone(&self) -> Result<Self, Error>

source§

impl TryClone for u8

source§

fn try_clone(&self) -> Result<Self, Error>

source§

impl TryClone for u16

source§

fn try_clone(&self) -> Result<Self, Error>

source§

impl TryClone for u32

source§

fn try_clone(&self) -> Result<Self, Error>

source§

impl TryClone for u64

source§

fn try_clone(&self) -> Result<Self, Error>

source§

impl TryClone for u128

source§

fn try_clone(&self) -> Result<Self, Error>

source§

impl TryClone for ()

source§

fn try_clone(&self) -> Result<Self, Error>

source§

impl TryClone for usize

source§

fn try_clone(&self) -> Result<Self, Error>

source§

impl TryClone for String

source§

fn try_clone(&self) -> Result<Self, Error>

source§

impl TryClone for NonZeroI8

source§

fn try_clone(&self) -> Result<Self, Error>

source§

impl TryClone for NonZeroI16

source§

fn try_clone(&self) -> Result<Self, Error>

source§

impl TryClone for NonZeroI32

source§

fn try_clone(&self) -> Result<Self, Error>

source§

impl TryClone for NonZeroI64

source§

fn try_clone(&self) -> Result<Self, Error>

source§

impl TryClone for NonZeroI128

source§

fn try_clone(&self) -> Result<Self, Error>

source§

impl TryClone for NonZeroIsize

source§

fn try_clone(&self) -> Result<Self, Error>

source§

impl TryClone for NonZeroU8

source§

fn try_clone(&self) -> Result<Self, Error>

source§

impl TryClone for NonZeroU16

source§

fn try_clone(&self) -> Result<Self, Error>

source§

impl TryClone for NonZeroU32

source§

fn try_clone(&self) -> Result<Self, Error>

source§

impl TryClone for NonZeroU64

source§

fn try_clone(&self) -> Result<Self, Error>

source§

impl TryClone for NonZeroU128

source§

fn try_clone(&self) -> Result<Self, Error>

source§

impl TryClone for NonZeroUsize

source§

fn try_clone(&self) -> Result<Self, Error>

source§

impl<A> TryClone for (A,)
where A: TryClone,

source§

fn try_clone(&self) -> Result<Self, Error>

source§

impl<A, B> TryClone for (A, B)
where A: TryClone, B: TryClone,

source§

fn try_clone(&self) -> Result<Self, Error>

source§

impl<A, B, C> TryClone for (A, B, C)
where A: TryClone, B: TryClone, C: TryClone,

source§

fn try_clone(&self) -> Result<Self, Error>

source§

impl<A, B, C, D> TryClone for (A, B, C, D)
where A: TryClone, B: TryClone, C: TryClone, D: TryClone,

source§

fn try_clone(&self) -> Result<Self, Error>

source§

impl<A, B, C, D, E> TryClone for (A, B, C, D, E)
where A: TryClone, B: TryClone, C: TryClone, D: TryClone, E: TryClone,

source§

fn try_clone(&self) -> Result<Self, Error>

source§

impl<A, B, C, D, E, F> TryClone for (A, B, C, D, E, F)
where A: TryClone, B: TryClone, C: TryClone, D: TryClone, E: TryClone, F: TryClone,

source§

fn try_clone(&self) -> Result<Self, Error>

source§

impl<A, B, C, D, E, F, G> TryClone for (A, B, C, D, E, F, G)
where A: TryClone, B: TryClone, C: TryClone, D: TryClone, E: TryClone, F: TryClone, G: TryClone,

source§

fn try_clone(&self) -> Result<Self, Error>

source§

impl<A, B, C, D, E, F, G, H> TryClone for (A, B, C, D, E, F, G, H)
where A: TryClone, B: TryClone, C: TryClone, D: TryClone, E: TryClone, F: TryClone, G: TryClone, H: TryClone,

source§

fn try_clone(&self) -> Result<Self, Error>

source§

impl<A, B, C, D, E, F, G, H, I> TryClone for (A, B, C, D, E, F, G, H, I)
where A: TryClone, B: TryClone, C: TryClone, D: TryClone, E: TryClone, F: TryClone, G: TryClone, H: TryClone, I: TryClone,

source§

fn try_clone(&self) -> Result<Self, Error>

source§

impl<A, B, C, D, E, F, G, H, I, J> TryClone for (A, B, C, D, E, F, G, H, I, J)
where A: TryClone, B: TryClone, C: TryClone, D: TryClone, E: TryClone, F: TryClone, G: TryClone, H: TryClone, I: TryClone, J: TryClone,

source§

fn try_clone(&self) -> Result<Self, Error>

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)
where A: TryClone, B: TryClone, C: TryClone, D: TryClone, E: TryClone, F: TryClone, G: TryClone, H: TryClone, I: TryClone, J: TryClone, K: TryClone,

source§

fn try_clone(&self) -> Result<Self, Error>

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)
where A: TryClone, B: TryClone, C: TryClone, D: TryClone, E: TryClone, F: TryClone, G: TryClone, H: TryClone, I: TryClone, J: TryClone, K: TryClone, L: TryClone,

source§

fn try_clone(&self) -> Result<Self, Error>

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)
where A: TryClone, B: TryClone, C: TryClone, D: TryClone, E: TryClone, F: TryClone, G: TryClone, H: TryClone, I: TryClone, J: TryClone, K: TryClone, L: TryClone, M: TryClone,

source§

fn try_clone(&self) -> Result<Self, Error>

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)
where A: TryClone, B: TryClone, C: TryClone, D: TryClone, E: TryClone, F: TryClone, G: TryClone, H: TryClone, I: TryClone, J: TryClone, K: TryClone, L: TryClone, M: TryClone, N: TryClone,

source§

fn try_clone(&self) -> Result<Self, Error>

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)
where A: TryClone, B: TryClone, C: TryClone, D: TryClone, E: TryClone, F: TryClone, G: TryClone, H: TryClone, I: TryClone, J: TryClone, K: TryClone, L: TryClone, M: TryClone, N: TryClone, O: TryClone,

source§

fn try_clone(&self) -> Result<Self, Error>

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)

source§

fn try_clone(&self) -> Result<Self, Error>

source§

impl<T> TryClone for Option<T>
where T: TryClone,

source§

fn try_clone(&self) -> Result<Self, Error>

source§

impl<T> TryClone for Box<[T]>
where T: TryClone,

source§

fn try_clone(&self) -> Result<Self, Error>

source§

impl<T> TryClone for Box<T>
where T: TryClone,

source§

fn try_clone(&self) -> Result<Self, Error>

source§

impl<T, E> TryClone for Result<T, E>
where T: TryClone, E: TryClone,

source§

fn try_clone(&self) -> Result<Self, Error>

source§

impl<T: ?Sized> TryClone for &T

source§

fn try_clone(&self) -> Result<Self, Error>

source§

impl<T: ?Sized> TryClone for Rc<T>

source§

fn try_clone(&self) -> Result<Self, Error>

source§

impl<T: ?Sized> TryClone for Arc<T>

source§

fn try_clone(&self) -> Result<Self, Error>

Implementors§

source§

impl TryClone for Cow<'_, str>

source§

impl TryClone for PathBuf

source§

impl<A: Allocator + Clone> TryClone for rune_alloc::boxed::Box<str, A>

source§

impl<A: Allocator + Clone> TryClone for rune_alloc::boxed::Box<Path, A>

source§

impl<A: Allocator + Clone> TryClone for rune_alloc::string::String<A>

source§

impl<K, V, S: Clone, A: Allocator + Clone> TryClone for HashMap<K, V, S, A>
where K: TryClone, V: TryClone,

source§

impl<K: TryClone, V: TryClone, A: Allocator + Clone> TryClone for BTreeMap<K, V, A>

source§

impl<T, A: Allocator + Clone> TryClone for rune_alloc::boxed::Box<[T], A>
where T: TryClone,

source§

impl<T, A: Allocator + Clone> TryClone for rune_alloc::boxed::Box<T, A>
where T: TryClone,

source§

impl<T, A: Allocator + Clone> TryClone for BTreeSet<T, A>
where T: TryClone,

source§

impl<T, A: Allocator + Clone> TryClone for RawTable<T, A>
where T: TryClone,

source§

impl<T, A: Allocator + Clone> TryClone for Vec<T, A>
where T: TryClone,

source§

impl<T, A: Allocator + Clone> TryClone for IntoIter<T, A>
where T: TryClone,

source§

impl<T, S, A: Allocator + Clone> TryClone for HashSet<T, S, A>
where T: TryClone, S: Clone,

source§

impl<T: TryClone, A: Allocator + Clone> TryClone for VecDeque<T, A>