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.
Auto Trait Implementations§
impl<'a, T, R> Freeze for RefFnMut<'a, T, R>
impl<'a, T, R> RefUnwindSafe for RefFnMut<'a, T, R>
impl<'a, T, R> !Send for RefFnMut<'a, T, R>
impl<'a, T, R> Unpin for RefFnMut<'a, T, R>
impl<'a, T, R> !UnwindSafe for RefFnMut<'a, T, R>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more