use crate::{Carrier, Fail, Fault, LaneProfile};
pub trait Reshape {
type WithDenied;
type WithoutDenied;
type WithTransient;
type WithoutTransient;
type WithFatal;
}
impl<L: LaneProfile> Reshape for Fault<L> {
type WithDenied = Fault<L::WithDenied>;
type WithoutDenied = Fault<L::WithoutDenied>;
type WithTransient = Fault<L::WithTransient>;
type WithoutTransient = Fault<L::WithoutTransient>;
type WithFatal = Fault<L::WithFatal>;
}
impl<D, L: LaneProfile> Reshape for Fail<D, L> {
type WithDenied = Fail<D, L::WithDenied>;
type WithoutDenied = Fail<D, L::WithoutDenied>;
type WithTransient = Fail<D, L::WithTransient>;
type WithoutTransient = Fail<D, L::WithoutTransient>;
type WithFatal = Fail<D, L::WithFatal>;
}
impl<C: Carrier> Reshape for C
where
C::Repr: Reshape,
{
type WithDenied = <C::Repr as Reshape>::WithDenied;
type WithoutDenied = <C::Repr as Reshape>::WithoutDenied;
type WithTransient = <C::Repr as Reshape>::WithTransient;
type WithoutTransient = <C::Repr as Reshape>::WithoutTransient;
type WithFatal = <C::Repr as Reshape>::WithFatal;
}
pub type WithDenied<E> = <E as Reshape>::WithDenied;
pub type WithoutDenied<E> = <E as Reshape>::WithoutDenied;
pub type WithTransient<E> = <E as Reshape>::WithTransient;
pub type WithoutTransient<E> = <E as Reshape>::WithoutTransient;
pub type WithFatal<E> = <E as Reshape>::WithFatal;