Trait cycler::CyclerWriterMutFn [−][src]
This trait enables the write half of the cycler to move to the next block using a clone function that takes a mutable reference to the previous block. This is not preferable as optimizations where the reader can read the previous block while it’s being cloned are not possible. The function arguments are (from, to)
Required methods
fn write_next_mut_fn(&mut self, clone_fn: fn(_: &mut T, _: &mut T))
[src]
Moves the writer to the next block cloning using an fn
pointer.
Arguments are (to, from)
This function uses an fn
pointer so has no additional runtime cost and can be called on a trait object.
fn write_next_mut_fn_impl(&mut self, clone_fn: impl FnOnce(&mut T, &mut T)) where
Self: Sized,
[src]
Self: Sized,
Moves the writer to the next block cloning using an FnOnce
impl
Arguments are (to, from)
This function is generic over the function reducing runtime cost but cannot be called on trait objects.
fn write_next_mut_fn_dyn(&mut self, clone_fn: &mut dyn FnMut(&mut T, &mut T))
[src]
Moves the writer to the next block cloning using an FnMut
dynamic reference.
Arguments are (to, from)
This function takes a dyn pointer so a v-table lookup is necessary.
write_next_mut_fn
is preferred if the function can be an fn
pointer or write_next_mut_fn_impl
is preferred if self is sized.
fn write_next_mut_fn_dyn_boxed(
&mut self,
clone_fn: Box<dyn FnOnce(&mut T, &mut T)>
)
[src]
&mut self,
clone_fn: Box<dyn FnOnce(&mut T, &mut T)>
)
Moves the writer to the next block cloning using a boxed FnOnce
Arguments are (to, from)
This function takes a boxed dyn pointer so a v-table lookup is necessary.
write_next_mut_fn_dyn
is preferred if the function can be coerced into an FnMut
as no heap allocation will be necessary.
Implementors
impl<T> CyclerWriterMutFn<T> for RwLockCyclerWriter<T> where
T: WriteAccess,
[src]
T: WriteAccess,
fn write_next_mut_fn(&mut self, clone_fn: fn(_: &mut T, _: &mut T))
[src]
fn write_next_mut_fn_impl(&mut self, clone_fn: impl FnOnce(&mut T, &mut T)) where
Self: Sized,
[src]
Self: Sized,
fn write_next_mut_fn_dyn(&mut self, clone_fn: &mut dyn FnMut(&mut T, &mut T))
[src]
fn write_next_mut_fn_dyn_boxed(
&mut self,
clone_fn: Box<dyn FnOnce(&mut T, &mut T)>
)
[src]
&mut self,
clone_fn: Box<dyn FnOnce(&mut T, &mut T)>
)