#[cfg(feature = "tuple_meta")]
pub trait TupleFnMeta<R> {
type DynFnOnce: ?Sized;
type DynFnMut: ?Sized;
type DynFn: ?Sized;
type FnPtr;
}
pub trait ApplyTupleMeta<Tuple> {
type Output;
type DynFnOnce: ?Sized;
type DynFnMut: ?Sized;
type DynFn: ?Sized;
type FnPtr;
}
pub trait ApplyTupleOnce<Tuple> {
type Output;
fn apply_tuple_once(self, args: Tuple) -> Self::Output;
}
pub trait ApplyTupleMut<Tuple>: ApplyTupleOnce<Tuple> {
fn apply_tuple_mut(&mut self, args: Tuple) -> Self::Output;
}
pub trait ApplyTuple<Tuple>: ApplyTupleMut<Tuple> {
fn apply_tuple(&self, args: Tuple) -> Self::Output;
}
include!("./gen/apply_tuple.rs");
#[test]
fn test1() {
let a = (1, 2, 3);
fn foo(a: i32, b: i32, c: i32) -> i32 {
a + b + c
}
let r = foo.apply_tuple(a);
assert_eq!(r, 6)
}
#[test]
fn test2() {
let a = (1, 2, 3);
fn foo(a: i32, b: i32, c: i32) -> i32 {
a + b + c
}
let r = foo.apply_tuple_mut(a);
assert_eq!(r, 6)
}
#[test]
fn test3() {
let a = (1, 2, 3);
fn foo(a: i32, b: i32, c: i32) -> i32 {
a + b + c
}
let r = foo.apply_tuple_once(a);
assert_eq!(r, 6)
}