[][src]Trait fallible_collections::TryClone

pub trait TryClone {
    pub fn try_clone(&self) -> Result<Self, TryReserveError>
    where
        Self: Sized
; }

trait for trying to clone an elem, return an error instead of panic if allocation failed

Examples

use fallible_collections::TryClone;
let mut vec = vec![42, 100];
assert_eq!(vec.try_clone().unwrap(), vec)

Required methods

pub fn try_clone(&self) -> Result<Self, TryReserveError> where
    Self: Sized
[src]

try clone method, (Self must be sized because of Result constraint)

Loading content...

Implementations on Foreign Types

impl<T: TryClone> TryClone for Box<T>[src]

impl<T: TryClone> TryClone for Vec<T>[src]

impl<T: ?Sized> TryClone for Arc<T>[src]

Just a TryClone boilerplate for Arc

impl<T: TryClone> TryClone for Option<T>[src]

Loading content...

Implementors

impl TryClone for bool[src]

impl TryClone for i8[src]

impl TryClone for i16[src]

impl TryClone for i32[src]

impl TryClone for i64[src]

impl TryClone for isize[src]

impl TryClone for u8[src]

impl TryClone for u16[src]

impl TryClone for u32[src]

impl TryClone for u64[src]

impl TryClone for usize[src]

impl<K, V> TryClone for TryHashMap<K, V> where
    K: Eq + Hash + TryClone,
    V: TryClone
[src]

impl<T: TryClone> TryClone for TryBox<T>[src]

impl<T: TryClone> TryClone for TryVec<T>[src]

Loading content...