[][src]Trait wyz::pipe::PipeDeref

pub trait PipeDeref {
    fn pipe_deref<'a, R>(
        &'a self,
        func: impl FnOnce(&'a Self::Target) -> R
    ) -> R
    where
        Self: Deref,
        R: 'a + Sized
, { ... }
fn pipe_deref_mut<'a, R>(
        &'a mut self,
        func: impl FnOnce(&'a mut Self::Target) -> R
    ) -> R
    where
        Self: DerefMut,
        R: 'a + Sized
, { ... } }

Calls the Deref or DerefMut traits before piping.

Provided methods

fn pipe_deref<'a, R>(&'a self, func: impl FnOnce(&'a Self::Target) -> R) -> R where
    Self: Deref,
    R: 'a + Sized

Pipes a dereference into a function that cannot normally be called in suffix position.

Parameters

  • &self: This borrows self for the same reasons as described in the
  • func: A function as described in the other methods. This receives the result of Deref::deref.

Lifetimes

  • 'a: The lifetime of the self value. .pipe_mut borrows self for the duration 'a, and extends it through the return value of func.

fn pipe_deref_mut<'a, R>(
    &'a mut self,
    func: impl FnOnce(&'a mut Self::Target) -> R
) -> R where
    Self: DerefMut,
    R: 'a + Sized

Pipes a mutable dereference into a function that cannot normally be called in suffix position.

Parameters

  • &mut self: This mutably borrows self for the same reasons as described in the other methods.
  • func: A function as described in the other methods. This receives the result of DerefMut::deref.

Lifetimes

  • 'a: The lifetime of the self value. .pipe_mut borrows self for the duration 'a, and extends it through the return value of func.
Loading content...

Implementors

impl<T> PipeDeref for T[src]

Loading content...