#![no_std]
mod select1;
mod select2;
mod select3;
pub use select1::{new as new1};
pub use select2::{new as new2};
pub use select3::{new as new3};
pub trait Selector1<A> {
type Output;
fn select(&mut self, arg1: A) -> Self::Output;
}
pub trait Selector2<A1, A2> {
type Output;
fn select(&mut self, arg1: A1, arg2: A2) -> Self::Output;
}
pub trait Selector3<A1, A2, A3> {
type Output;
fn select(&mut self, arg1: A1, arg2: A2, arg3: A3) -> Self::Output;
}
impl<A1, R, T: FnMut(A1) -> R> Selector1<A1> for T {
type Output = R;
#[inline]
fn select(&mut self, arg1: A1) -> Self::Output {
(self)(arg1)
}
}
impl<A1, A2, R, T: FnMut(A1, A2) -> R> Selector2<A1, A2> for T {
type Output = R;
#[inline]
fn select(&mut self, arg1: A1, arg2: A2) -> Self::Output {
(self)(arg1, arg2)
}
}
impl<A1, A2, A3, R, T: FnMut(A1, A2, A3) -> R> Selector3<A1, A2, A3> for T {
type Output = R;
#[inline]
fn select(&mut self, arg1: A1, arg2: A2, arg3: A3) -> Self::Output {
(self)(arg1, arg2, arg3)
}
}