Trait wyz::pipe::PipeAsRef [−][src]
Calls the AsRef
or AsMut
traits before piping.
Provided methods
fn pipe_as_ref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R where
Self: AsRef<T>,
T: 'a,
R: 'a + Sized,
[src]
Self: AsRef<T>,
T: 'a,
R: 'a + Sized,
Pipes a trait borrow into a function that cannot normally be called in suffix position.
Parameters
&self
: This borrowsself
for the same reasons as described in the other methods.func
: A function as described in the other methods. This receives the result ofAsRef::<T>::as_ref
.
Lifetimes
'a
: The lifetime of theself
value..pipe_mut
borrowsself
for the duration'a
, and extends it through the return value offunc
.
fn pipe_as_mut<'a, T, R>(&'a mut self, func: impl FnOnce(&'a mut T) -> R) -> R where
Self: AsMut<T>,
T: 'a,
R: 'a + Sized,
[src]
Self: AsMut<T>,
T: 'a,
R: 'a + Sized,
Pipes a trait mutable borrow into a function that cannot normally be called in suffix position.
Parameters
&mut self
: This borrowsself
for the same reasons as described in the other methods.func
: A function as described in the other methods. This receives the result ofAsMut::<T>::as_mut
.
Lifetimes
'a
: The lifetime of theself
value..pipe_mut
borrowsself
for the duration'a
, and extends it through the return value offunc
.