IntoBlock

Trait IntoBlock 

Source
pub unsafe trait IntoBlock<'f, A, R>: Sealed<A, R>{
    type Dyn: ?Sized + BlockFn<Args = A, Output = R>;
}
Expand description

Types that may be converted into a block.

This is implemented for Fn closures of up to 12 parameters, where each parameter implements EncodeArgument and the return type implements EncodeReturn.

§Safety

This is a sealed trait, and should not need to be implemented. Open an issue if you know a use-case where this restrition should be lifted!

Required Associated Types§

Source

type Dyn: ?Sized + BlockFn<Args = A, Output = R>

The type-erased dyn Fn(...Args) -> R + 'f.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl<'f, R, Closure> IntoBlock<'f, (), R> for Closure
where R: EncodeReturn, Closure: Fn() -> R + 'f,

Source§

type Dyn = dyn Fn() -> R + 'f

Source§

impl<'f, T0, R, Closure> IntoBlock<'f, (T0,), R> for Closure
where T0: EncodeArgument, R: EncodeReturn, Closure: Fn(T0) -> R + 'f,

Source§

type Dyn = dyn Fn(T0) -> R + 'f

Source§

impl<'f, T0, T1, R, Closure> IntoBlock<'f, (T0, T1), R> for Closure
where T0: EncodeArgument, T1: EncodeArgument, R: EncodeReturn, Closure: Fn(T0, T1) -> R + 'f,

Source§

type Dyn = dyn Fn(T0, T1) -> R + 'f

Source§

impl<'f, T0, T1, T2, R, Closure> IntoBlock<'f, (T0, T1, T2), R> for Closure
where T0: EncodeArgument, T1: EncodeArgument, T2: EncodeArgument, R: EncodeReturn, Closure: Fn(T0, T1, T2) -> R + 'f,

Source§

type Dyn = dyn Fn(T0, T1, T2) -> R + 'f

Source§

impl<'f, T0, T1, T2, T3, R, Closure> IntoBlock<'f, (T0, T1, T2, T3), R> for Closure
where T0: EncodeArgument, T1: EncodeArgument, T2: EncodeArgument, T3: EncodeArgument, R: EncodeReturn, Closure: Fn(T0, T1, T2, T3) -> R + 'f,

Source§

type Dyn = dyn Fn(T0, T1, T2, T3) -> R + 'f

Source§

impl<'f, T0, T1, T2, T3, T4, R, Closure> IntoBlock<'f, (T0, T1, T2, T3, T4), R> for Closure
where T0: EncodeArgument, T1: EncodeArgument, T2: EncodeArgument, T3: EncodeArgument, T4: EncodeArgument, R: EncodeReturn, Closure: Fn(T0, T1, T2, T3, T4) -> R + 'f,

Source§

type Dyn = dyn Fn(T0, T1, T2, T3, T4) -> R + 'f

Source§

impl<'f, T0, T1, T2, T3, T4, T5, R, Closure> IntoBlock<'f, (T0, T1, T2, T3, T4, T5), R> for Closure
where T0: EncodeArgument, T1: EncodeArgument, T2: EncodeArgument, T3: EncodeArgument, T4: EncodeArgument, T5: EncodeArgument, R: EncodeReturn, Closure: Fn(T0, T1, T2, T3, T4, T5) -> R + 'f,

Source§

type Dyn = dyn Fn(T0, T1, T2, T3, T4, T5) -> R + 'f

Source§

impl<'f, T0, T1, T2, T3, T4, T5, T6, R, Closure> IntoBlock<'f, (T0, T1, T2, T3, T4, T5, T6), R> for Closure
where T0: EncodeArgument, T1: EncodeArgument, T2: EncodeArgument, T3: EncodeArgument, T4: EncodeArgument, T5: EncodeArgument, T6: EncodeArgument, R: EncodeReturn, Closure: Fn(T0, T1, T2, T3, T4, T5, T6) -> R + 'f,

Source§

type Dyn = dyn Fn(T0, T1, T2, T3, T4, T5, T6) -> R + 'f

Source§

impl<'f, T0, T1, T2, T3, T4, T5, T6, T7, R, Closure> IntoBlock<'f, (T0, T1, T2, T3, T4, T5, T6, T7), R> for Closure
where T0: EncodeArgument, T1: EncodeArgument, T2: EncodeArgument, T3: EncodeArgument, T4: EncodeArgument, T5: EncodeArgument, T6: EncodeArgument, T7: EncodeArgument, R: EncodeReturn, Closure: Fn(T0, T1, T2, T3, T4, T5, T6, T7) -> R + 'f,

Source§

type Dyn = dyn Fn(T0, T1, T2, T3, T4, T5, T6, T7) -> R + 'f

Source§

impl<'f, T0, T1, T2, T3, T4, T5, T6, T7, T8, R, Closure> IntoBlock<'f, (T0, T1, T2, T3, T4, T5, T6, T7, T8), R> for Closure
where T0: EncodeArgument, T1: EncodeArgument, T2: EncodeArgument, T3: EncodeArgument, T4: EncodeArgument, T5: EncodeArgument, T6: EncodeArgument, T7: EncodeArgument, T8: EncodeArgument, R: EncodeReturn, Closure: Fn(T0, T1, T2, T3, T4, T5, T6, T7, T8) -> R + 'f,

Source§

type Dyn = dyn Fn(T0, T1, T2, T3, T4, T5, T6, T7, T8) -> R + 'f

Source§

impl<'f, T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, R, Closure> IntoBlock<'f, (T0, T1, T2, T3, T4, T5, T6, T7, T8, T9), R> for Closure
where T0: EncodeArgument, T1: EncodeArgument, T2: EncodeArgument, T3: EncodeArgument, T4: EncodeArgument, T5: EncodeArgument, T6: EncodeArgument, T7: EncodeArgument, T8: EncodeArgument, T9: EncodeArgument, R: EncodeReturn, Closure: Fn(T0, T1, T2, T3, T4, T5, T6, T7, T8, T9) -> R + 'f,

Source§

type Dyn = dyn Fn(T0, T1, T2, T3, T4, T5, T6, T7, T8, T9) -> R + 'f

Source§

impl<'f, T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, R, Closure> IntoBlock<'f, (T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10), R> for Closure
where T0: EncodeArgument, T1: EncodeArgument, T2: EncodeArgument, T3: EncodeArgument, T4: EncodeArgument, T5: EncodeArgument, T6: EncodeArgument, T7: EncodeArgument, T8: EncodeArgument, T9: EncodeArgument, T10: EncodeArgument, R: EncodeReturn, Closure: Fn(T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10) -> R + 'f,

Source§

type Dyn = dyn Fn(T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10) -> R + 'f

Source§

impl<'f, T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, R, Closure> IntoBlock<'f, (T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11), R> for Closure
where T0: EncodeArgument, T1: EncodeArgument, T2: EncodeArgument, T3: EncodeArgument, T4: EncodeArgument, T5: EncodeArgument, T6: EncodeArgument, T7: EncodeArgument, T8: EncodeArgument, T9: EncodeArgument, T10: EncodeArgument, T11: EncodeArgument, R: EncodeReturn, Closure: Fn(T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11) -> R + 'f,

Source§

type Dyn = dyn Fn(T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11) -> R + 'f