use super::mapper::Mapper;
#[derive(Default,Clone, Copy)]
pub struct AsSelf;
impl<T> Mapper<T> for AsSelf {
type Output = T;
fn map(&self,value:T)->Self::Output {value}
}
pub struct MapperMapper<'a,TMapperA,TMapperB>(pub &'a TMapperA,pub &'a TMapperB);
impl<'a,TMapperA,TMapperB,Input> Mapper<Input> for MapperMapper<'a,TMapperA,TMapperB>
where TMapperA:Mapper<Input>,
TMapperB:Mapper< <TMapperA as Mapper<Input>>::Output >
{
type Output=<TMapperB as Mapper< <TMapperA as Mapper<Input>>::Output >>::Output;
fn map(&self,value:Input)->Self::Output {
self.1.map(self.0.map(value))
}
}