Skip to main content

StaticRefMutFunction

Trait StaticRefMutFunction 

Source
pub trait StaticRefMutFunction<'a, D, T> {
    type Output;

    // Required method
    fn call_mut(data: &'a mut D, arg: T) -> Self::Output;

    // Provided methods
    fn bind(data: &'a mut D) -> RefFnMut<'a, T, Self::Output> { ... }
    fn bind_send(data: &'a mut D) -> RefSendFnMut<'a, T, Self::Output>
       where D: Send { ... }
}
Expand description

A trait for defining a static function that will be type erased.

Required Associated Types§

Source

type Output

Return type of the defined function.

Required Methods§

Source

fn call_mut(data: &'a mut D, arg: T) -> Self::Output

Function definition.

Provided Methods§

Source

fn bind(data: &'a mut D) -> RefFnMut<'a, T, Self::Output>

A helper function to create a RefFnMut object with the defined function.

Source

fn bind_send(data: &'a mut D) -> RefSendFnMut<'a, T, Self::Output>
where D: Send,

A helper function to create a RefSendFnMut object with the defined function.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl<'a, T, F, R> StaticRefMutFunction<'a, F, T> for F
where F: FnMut(T) -> R,