Struct simple_ref_fn::RefFnMut
source · pub struct RefFnMut<'a, T, R> { /* private fields */ }Expand description
A simple function wrapper that behaves like a &mut dyn FnMut(T) -> R type, but does not require a
virtual table.
Implementations§
source§impl<'a, T, R> RefFnMut<'a, T, R>
impl<'a, T, R> RefFnMut<'a, T, R>
sourcepub fn new<F, D>(data: &'a mut D) -> Selfwhere
F: StaticRefMutFunction<'a, D, T, Output = R> + ?Sized,
pub fn new<F, D>(data: &'a mut D) -> Selfwhere
F: StaticRefMutFunction<'a, D, T, Output = R> + ?Sized,
Create a RefFnMut object by binding F::call_mut function with data.
sourcepub fn from_fn_mut<F>(f: &'a mut F) -> Selfwhere
F: FnMut(T) -> R,
pub fn from_fn_mut<F>(f: &'a mut F) -> Selfwhere
F: FnMut(T) -> R,
Create a RefFnMut object from a function reference.
Trait Implementations§
impl<T, R> Sync for RefFnMut<'_, T, R>
Unconditionally Sync because this type only provides mutable access, so sharing non-mutable reference is safe.