Trait tlist::EitherPrefix
source · pub trait EitherPrefix<Other: TList> { }
Expand description
Constraint which either holds if a TList is a prefix of Other
or if Other
is a prefix of this TList.
Relaxed variant of Prefix.
use tlist::*;
use typenum::consts::{U1, U2, U3, U4, U42};
static_assertions::assert_impl_all!(TList![U1, U2]: EitherPrefix<TList![U1, U2, U3, U4]>);
static_assertions::assert_impl_all!(TList![U1, U2, U3, U4]: EitherPrefix<TList![U1, U2]>);
static_assertions::assert_not_impl_any!(TList![U42]: EitherPrefix<TList![U1, U2, U3, U4]>);
static_assertions::assert_not_impl_any!(TList![U1, U2, U3, U4]: EitherPrefix<TList![U4, U3, U2, U1]>);