TupleFnMut

Trait TupleFnMut 

Source
pub trait TupleFnMut<Args>: TupleFnOnce<Args> {
    // Required method
    fn call_mut_with_args_tuple(&mut self, args: Args) -> Self::TupleFnOutput;
}
Expand description

Enables the types which implements FnMut to be called with arguments tuple.

use tuple_fn::TupleFnMut;

let mut result = vec![1, 2];

let mut closure = |value, prepend| {
    if prepend {
        result.insert(0, value);
    } else {
        result.push(value);
    }
};

closure(0, true);
closure(3, false);

assert_eq!(result, [0, 1, 2, 3]);

Required Methods§

Source

fn call_mut_with_args_tuple(&mut self, args: Args) -> Self::TupleFnOutput

Implementors§

Source§

impl<R, T: FnMut() -> R> TupleFnMut<()> for T

Source§

impl<R, T: FnMut(A1) -> R, A1> TupleFnMut<(A1,)> for T

Source§

impl<R, T: FnMut(A1, A2) -> R, A1, A2> TupleFnMut<(A1, A2)> for T

Source§

impl<R, T: FnMut(A1, A2, A3) -> R, A1, A2, A3> TupleFnMut<(A1, A2, A3)> for T

Source§

impl<R, T: FnMut(A1, A2, A3, A4) -> R, A1, A2, A3, A4> TupleFnMut<(A1, A2, A3, A4)> for T

Source§

impl<R, T: FnMut(A1, A2, A3, A4, A5) -> R, A1, A2, A3, A4, A5> TupleFnMut<(A1, A2, A3, A4, A5)> for T

Source§

impl<R, T: FnMut(A1, A2, A3, A4, A5, A6) -> R, A1, A2, A3, A4, A5, A6> TupleFnMut<(A1, A2, A3, A4, A5, A6)> for T

Source§

impl<R, T: FnMut(A1, A2, A3, A4, A5, A6, A7) -> R, A1, A2, A3, A4, A5, A6, A7> TupleFnMut<(A1, A2, A3, A4, A5, A6, A7)> for T

Source§

impl<R, T: FnMut(A1, A2, A3, A4, A5, A6, A7, A8) -> R, A1, A2, A3, A4, A5, A6, A7, A8> TupleFnMut<(A1, A2, A3, A4, A5, A6, A7, A8)> for T

Source§

impl<R, T: FnMut(A1, A2, A3, A4, A5, A6, A7, A8, A9) -> R, A1, A2, A3, A4, A5, A6, A7, A8, A9> TupleFnMut<(A1, A2, A3, A4, A5, A6, A7, A8, A9)> for T

Source§

impl<R, T: FnMut(A1, A2, A3, A4, A5, A6, A7, A8, A9, A10) -> R, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10> TupleFnMut<(A1, A2, A3, A4, A5, A6, A7, A8, A9, A10)> for T

Source§

impl<R, T: FnMut(A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11) -> R, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11> TupleFnMut<(A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11)> for T

Source§

impl<R, T: FnMut(A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12) -> R, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12> TupleFnMut<(A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12)> for T

Source§

impl<R, T: FnMut(A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13) -> R, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13> TupleFnMut<(A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13)> for T

Source§

impl<R, T: FnMut(A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14) -> R, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14> TupleFnMut<(A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14)> for T

Source§

impl<R, T: FnMut(A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15) -> R, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15> TupleFnMut<(A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15)> for T