Trait cushy::WithClone

source ·
pub trait WithClone: Sized {
    type Cloned;

    // Required method
    fn with_clone<R>(&self, with: impl FnOnce(Self::Cloned) -> R) -> R;
}
Expand description

Invokes a function with a clone of self.

Required Associated Types§

source

type Cloned

The type that results from cloning.

Required Methods§

source

fn with_clone<R>(&self, with: impl FnOnce(Self::Cloned) -> R) -> R

Maps with with the results of cloning self.

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl<'a, T0: Clone> WithClone for (&'a T0,)

§

type Cloned = (T0,)

source§

fn with_clone<R>(&self, with: impl FnOnce(Self::Cloned) -> R) -> R

source§

impl<'a, T0: Clone, T1: Clone> WithClone for (&'a T0, &'a T1)

§

type Cloned = (T0, T1)

source§

fn with_clone<R>(&self, with: impl FnOnce(Self::Cloned) -> R) -> R

source§

impl<'a, T0: Clone, T1: Clone, T2: Clone> WithClone for (&'a T0, &'a T1, &'a T2)

§

type Cloned = (T0, T1, T2)

source§

fn with_clone<R>(&self, with: impl FnOnce(Self::Cloned) -> R) -> R

source§

impl<'a, T0: Clone, T1: Clone, T2: Clone, T3: Clone> WithClone for (&'a T0, &'a T1, &'a T2, &'a T3)

§

type Cloned = (T0, T1, T2, T3)

source§

fn with_clone<R>(&self, with: impl FnOnce(Self::Cloned) -> R) -> R

source§

impl<'a, T0: Clone, T1: Clone, T2: Clone, T3: Clone, T4: Clone> WithClone for (&'a T0, &'a T1, &'a T2, &'a T3, &'a T4)

§

type Cloned = (T0, T1, T2, T3, T4)

source§

fn with_clone<R>(&self, with: impl FnOnce(Self::Cloned) -> R) -> R

source§

impl<'a, T0: Clone, T1: Clone, T2: Clone, T3: Clone, T4: Clone, T5: Clone> WithClone for (&'a T0, &'a T1, &'a T2, &'a T3, &'a T4, &'a T5)

§

type Cloned = (T0, T1, T2, T3, T4, T5)

source§

fn with_clone<R>(&self, with: impl FnOnce(Self::Cloned) -> R) -> R

source§

impl<'a, T> WithClone for &'a T
where T: Clone,

§

type Cloned = T

source§

fn with_clone<R>(&self, with: impl FnOnce(Self::Cloned) -> R) -> R

Implementors§