Trait wyz::pipe::PipeDeref [−][src]
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,
[src]
Self: Deref,
R: 'a + Sized,
Pipes a dereference into a function that cannot normally be called in suffix position.
Parameters
&self
: This borrowsself
for the same reasons as described in thefunc
: A function as described in the other methods. This receives the result ofDeref::deref
.
Lifetimes
'a
: The lifetime of theself
value..pipe_mut
borrowsself
for the duration'a
, and extends it through the return value offunc
.
fn pipe_deref_mut<'a, R>(
&'a mut self,
func: impl FnOnce(&'a mut Self::Target) -> R
) -> R where
Self: DerefMut,
R: 'a + Sized,
[src]
&'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 borrowsself
for the same reasons as described in the other methods.func
: A function as described in the other methods. This receives the result ofDerefMut::deref
.
Lifetimes
'a
: The lifetime of theself
value..pipe_mut
borrowsself
for the duration'a
, and extends it through the return value offunc
.