Skip to main content

TryClone

Trait TryClone 

Source
pub trait TryClone: Sized {
    type Error: Debug;

    // Required method
    fn try_clone(&self) -> Result<Self, Self::Error>;
}
Expand description

A trait for types that can be cloned with a result.

Required Associated Types§

Required Methods§

Source

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

Tries to clone the type.

§Errors

Returns the error if the clone fails for whatever reason.

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 TryClone for ()

Source§

type Error = Infallible

Source§

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

Source§

impl TryClone for bool

Source§

type Error = Infallible

Source§

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

Source§

impl TryClone for char

Source§

type Error = Infallible

Source§

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

Source§

impl TryClone for f32

Source§

type Error = Infallible

Source§

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

Source§

impl TryClone for f64

Source§

type Error = Infallible

Source§

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

Source§

impl TryClone for i8

Source§

type Error = Infallible

Source§

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

Source§

impl TryClone for i16

Source§

type Error = Infallible

Source§

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

Source§

impl TryClone for i32

Source§

type Error = Infallible

Source§

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

Source§

impl TryClone for i64

Source§

type Error = Infallible

Source§

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

Source§

impl TryClone for i128

Source§

type Error = Infallible

Source§

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

Source§

impl TryClone for isize

Source§

type Error = Infallible

Source§

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

Source§

impl TryClone for u8

Source§

type Error = Infallible

Source§

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

Source§

impl TryClone for u16

Source§

type Error = Infallible

Source§

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

Source§

impl TryClone for u32

Source§

type Error = Infallible

Source§

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

Source§

impl TryClone for u64

Source§

type Error = Infallible

Source§

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

Source§

impl TryClone for u128

Source§

type Error = Infallible

Source§

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

Source§

impl TryClone for usize

Source§

type Error = Infallible

Source§

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

Source§

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

Source§

type Error = <T as TryClone>::Error

Source§

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

Source§

impl<T: TryClone> TryClone for PhantomData<T>

Source§

type Error = Infallible

Source§

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

Source§

impl<const N: usize, T: TryClone> TryClone for [T; N]

Source§

type Error = <T as TryClone>::Error

Source§

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

Implementors§