use core::marker::Tuple;
use tupleops::TupleConcat;
use super::*;
#[const_trait]
pub trait FnZip<RX, LX, Rhs>
{
type Output;
fn fn_zip_once(self, rhs: Rhs) -> Self::Output;
fn fn_zip_mut<'a>(&'a mut self, rhs: Rhs) -> <&'a mut Self as FnZip<RX, LX, Rhs>>::Output
where
&'a mut Self: ~const FnZip<RX, LX, Rhs>
{
self.fn_zip_once(rhs)
}
fn fn_zip<'a>(&'a self, rhs: Rhs) -> <&'a Self as FnZip<RX, LX, Rhs>>::Output
where
&'a Self: ~const FnZip<RX, LX, Rhs>
{
self.fn_zip_once(rhs)
}
}
impl<RX, LX, LF, RF> const FnZip<RX, LX, RF> for LF
where
LX: Tuple,
RX: Tuple,
LF: FnOnce<LX>,
RF: FnOnce<RX>,
(LX, RX): TupleConcat<LX, RX, Type: Tuple>
{
type Output = ZippedFn<LX, RX, LF, RF>;
fn fn_zip_once(self, rhs: RF) -> Self::Output
{
ZippedFn::new(self, rhs)
}
}