Trait thin::FnMove [] [src]

pub trait FnMove<Args>: FnOnce<Args> {
    unsafe fn call_move(&mut self, args: Args) -> Self::Output;
}

A version of FnOnce that takes self by &mut reference instead of by value.

This allows you to implement FnOnce on a type owning an FnMove trait object, as long as the wrapper type is Sized.

This trait will be obsolete once the unsized rvalues RFC is implemented.

Required Methods

Unsafety

Unsafe because this takes self by reference, but treats it as moved. The caller must somehow stop the closure's destructor from running afterwards, whether that's by calling mem::forget on it or something else.

Trait Implementations

impl<'a, Args, Output> DynSized for FnMove<Args, Output = Output> + 'a
[src]

[src]

[src]

[src]

[src]

[src]

[src]

[src]

impl<'a, Args, Output> DynSized for FnMove<Args, Output = Output> + 'a + Send
[src]

[src]

[src]

[src]

[src]

[src]

[src]

[src]

Implementors