Skip to main content

TryClone

Trait TryClone 

Source
pub trait TryClone: Sized {
    // Required method
    fn try_clone(&self) -> Result<Self, SerError>;
}
Expand description

A fallable version of the Clone trait

Required Methods§

Source

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

Tries to produce a copy of self or returns an error

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.

Implementors§