use crate::misc::Lease;
pub trait DEController {
type Aux;
type DecodeWrapper<'inner, 'outer>: Lease<[u8]>
where
'inner: 'outer;
type Error: From<crate::Error>;
type EncodeWrapper<'inner, 'outer>: Lease<[u8]>
where
'inner: 'outer;
}
impl DEController for () {
type Aux = ();
type DecodeWrapper<'inner, 'outer>
= ()
where
'inner: 'outer;
type Error = crate::Error;
type EncodeWrapper<'inner, 'outer>
= ()
where
'inner: 'outer;
}
impl<T> DEController for &T
where
T: DEController,
{
type Aux = T::Aux;
type DecodeWrapper<'inner, 'outer>
= T::DecodeWrapper<'inner, 'outer>
where
'inner: 'outer;
type Error = T::Error;
type EncodeWrapper<'inner, 'outer>
= T::EncodeWrapper<'inner, 'outer>
where
'inner: 'outer;
}
impl<T> DEController for &mut T
where
T: DEController,
{
type Aux = T::Aux;
type DecodeWrapper<'inner, 'outer>
= T::DecodeWrapper<'inner, 'outer>
where
'inner: 'outer;
type Error = T::Error;
type EncodeWrapper<'inner, 'outer>
= T::EncodeWrapper<'inner, 'outer>
where
'inner: 'outer;
}