shallowclone

Trait ShallowClone

Source
pub trait ShallowClone<'a> {
    type Target;

    // Required method
    fn shallow_clone(&'a self) -> Self::Target;
}
Expand description

The same as Clone, but doesnt clone Cow values, instead it just borrows them.

Required Associated Types§

Required Methods§

Source

fn shallow_clone(&'a self) -> Self::Target

Implementations on Foreign Types§

Source§

impl<'a> ShallowClone<'a> for bool

Source§

type Target = bool

Source§

fn shallow_clone(&'a self) -> Self::Target

Source§

impl<'a> ShallowClone<'a> for char

Source§

type Target = char

Source§

fn shallow_clone(&'a self) -> Self::Target

Source§

impl<'a> ShallowClone<'a> for f32

Source§

type Target = f32

Source§

fn shallow_clone(&'a self) -> Self::Target

Source§

impl<'a> ShallowClone<'a> for f64

Source§

type Target = f64

Source§

fn shallow_clone(&'a self) -> Self::Target

Source§

impl<'a> ShallowClone<'a> for i8

Source§

type Target = i8

Source§

fn shallow_clone(&'a self) -> Self::Target

Source§

impl<'a> ShallowClone<'a> for i16

Source§

type Target = i16

Source§

fn shallow_clone(&'a self) -> Self::Target

Source§

impl<'a> ShallowClone<'a> for i32

Source§

type Target = i32

Source§

fn shallow_clone(&'a self) -> Self::Target

Source§

impl<'a> ShallowClone<'a> for i64

Source§

type Target = i64

Source§

fn shallow_clone(&'a self) -> Self::Target

Source§

impl<'a> ShallowClone<'a> for i128

Source§

type Target = i128

Source§

fn shallow_clone(&'a self) -> Self::Target

Source§

impl<'a> ShallowClone<'a> for u8

Source§

type Target = u8

Source§

fn shallow_clone(&'a self) -> Self::Target

Source§

impl<'a> ShallowClone<'a> for u16

Source§

type Target = u16

Source§

fn shallow_clone(&'a self) -> Self::Target

Source§

impl<'a> ShallowClone<'a> for u32

Source§

type Target = u32

Source§

fn shallow_clone(&'a self) -> Self::Target

Source§

impl<'a> ShallowClone<'a> for u64

Source§

type Target = u64

Source§

fn shallow_clone(&'a self) -> Self::Target

Source§

impl<'a> ShallowClone<'a> for u128

Source§

type Target = u128

Source§

fn shallow_clone(&'a self) -> Self::Target

Source§

impl<'a> ShallowClone<'a> for String

Source§

impl<'a, 'b, T: ToOwned + ?Sized> ShallowClone<'a> for Cow<'b, T>
where 'b: 'a,

Source§

type Target = Cow<'a, T>

Source§

fn shallow_clone(&'a self) -> Self::Target

Source§

impl<'a, 'b, T: ?Sized> ShallowClone<'a> for &'b T
where 'b: 'a,

Source§

type Target = &'a T

Source§

fn shallow_clone(&'a self) -> Self::Target

Source§

impl<'a, K: ShallowClone<'a>, V: ShallowClone<'a>> ShallowClone<'a> for BTreeMap<K, V>
where K::Target: Eq + Ord,

Source§

type Target = BTreeMap<<K as ShallowClone<'a>>::Target, <V as ShallowClone<'a>>::Target>

Source§

fn shallow_clone(&'a self) -> Self::Target

Source§

impl<'a, K: ShallowClone<'a>, V: ShallowClone<'a>> ShallowClone<'a> for HashMap<K, V>
where K::Target: Eq + Hash,

Source§

type Target = HashMap<<K as ShallowClone<'a>>::Target, <V as ShallowClone<'a>>::Target>

Source§

fn shallow_clone(&'a self) -> Self::Target

Source§

impl<'a, T> ShallowClone<'a> for PhantomData<T>

Source§

impl<'a, T: ShallowClone<'a>> ShallowClone<'a> for Option<T>

Source§

type Target = Option<<T as ShallowClone<'a>>::Target>

Source§

fn shallow_clone(&'a self) -> Self::Target

Source§

impl<'a, T: ShallowClone<'a>> ShallowClone<'a> for Box<T>

Source§

type Target = Box<<T as ShallowClone<'a>>::Target>

Source§

fn shallow_clone(&'a self) -> Self::Target

Source§

impl<'a, T: ShallowClone<'a>> ShallowClone<'a> for Vec<T>

Source§

type Target = Vec<<T as ShallowClone<'a>>::Target>

Source§

fn shallow_clone(&'a self) -> Self::Target

Source§

impl<'a, const N: usize, T: ShallowClone<'a>> ShallowClone<'a> for [T; N]

Source§

type Target = [<T as ShallowClone<'a>>::Target; N]

Source§

fn shallow_clone(&'a self) -> Self::Target

Implementors§

Source§

impl<'a, T> ShallowClone<'a> for CoCow<'a, T>

Source§

type Target = CoCow<'a, T>

Source§

impl<'a, T> ShallowClone<'a> for CoCowSlice<'a, T>