rune_alloc::clone

Trait TryClone

Source
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.

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.

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 ExitStatus

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, A> TryClone for HashMap<K, V, S, A>
where K: TryClone, V: TryClone, S: Clone, A: Allocator + Clone,

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>