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]>);

Implementors§

source§

impl EitherPrefix<TNil> for TNil

source§

impl<F, FS, GS: TList> EitherPrefix<TCons<F, GS>> for TCons<F, FS>where FS: EitherPrefix<GS> + TList,

source§

impl<F, FS: TList> EitherPrefix<TNil> for TCons<F, FS>

source§

impl<F, GS: TList> EitherPrefix<TCons<F, GS>> for TNil