Trait cycler::CyclerWriterFn[][src]

pub trait CyclerWriterFn<T>: CyclerWriter<T> where
    T: WriteAccess
{ fn write_next_fn(&mut self, clone_fn: fn(_: &mut T, _: &T));
fn write_next_fn_impl(&mut self, clone_fn: impl FnOnce(&mut T, &T))
    where
        Self: Sized
;
fn write_next_fn_dyn(&mut self, clone_fn: &mut dyn FnMut(&mut T, &T));
fn write_next_fn_dyn_boxed(&mut self, clone_fn: Box<dyn FnOnce(&mut T, &T)>); }

This trait enables the write half of the cycler to move to the next block using a given clone function. This function follows the signature of Clone::clone_from, meaning the arguments are (to, from).

Required methods

fn write_next_fn(&mut self, clone_fn: fn(_: &mut T, _: &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_fn_impl(&mut self, clone_fn: impl FnOnce(&mut T, &T)) where
    Self: Sized
[src]

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_fn_dyn(&mut self, clone_fn: &mut dyn FnMut(&mut T, &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_fn is preferred if the function can be an fn pointer or write_next_fn_impl is preferred if self is sized.

fn write_next_fn_dyn_boxed(&mut self, clone_fn: Box<dyn FnOnce(&mut T, &T)>)[src]

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_fn_dyn is preferred if the function can be coerced into an FnMut as no heap allocation will be necessary.

Loading content...

Implementors

impl<T> CyclerWriterFn<T> for AtomicCyclerWriter<T> where
    T: WriteAccess
[src]

impl<T> CyclerWriterFn<T> for RwLockCyclerWriter<T> where
    T: WriteAccess
[src]

Loading content...