typewit/
base_type_wit.rs

1//! abstractions over
2//! [`TypeEq`](crate::TypeEq)/[`TypeNe`](crate::TypeNe)/[`TypeCmp`](crate::TypeCmp).
3
4
5mod meta_base_type_wit;
6
7pub use meta_base_type_wit::MetaBaseTypeWit;
8
9
10/// Marker trait for 
11/// [`TypeCmp`](crate::TypeCmp)/[`TypeEq`](crate::TypeEq)/[`TypeNe`](crate::TypeNe).
12/// 
13/// [`TypeEq`]: crate::TypeEq
14/// [`TypeNe`]: crate::TypeNe
15/// [`TypeCmp`]: crate::TypeCmp
16#[cfg_attr(feature = "docsrs", doc(cfg(feature = "rust_1_61")))]
17pub trait BaseTypeWitness: 
18    core::fmt::Debug + 
19    Copy + 
20    crate::HasTypeWitness<MetaBaseTypeWit<Self::L, Self::R, Self>>
21{
22    /// The `L` type parameter of `TypeEq`/`TypeNe`/`TypeCmp` types.
23    type L: ?Sized;
24    /// The `R` type parameter of `TypeEq`/`TypeNe`/`TypeCmp` types.
25    type R: ?Sized;
26    
27    /// The [type constructor] corresponding to this type.
28    ///
29    /// [type constructor]: crate::type_constructors::BaseTypeWitnessTc
30    #[cfg(feature = "rust_1_65")]
31    #[cfg_attr(feature = "docsrs", doc(cfg(feature = "rust_1_65")))]
32    type TypeCtor: crate::type_constructors::BaseTypeWitnessTc<Type<Self::L, Self::R> = Self>;
33}
34
35
36impl<L: ?Sized, R: ?Sized> BaseTypeWitness for crate::TypeEq<L, R> {
37    type L = L;
38    type R = R;
39
40    #[cfg(feature = "rust_1_65")]
41    type TypeCtor = crate::type_constructors::TcTypeEq;
42
43}
44
45impl<L: ?Sized, R: ?Sized> BaseTypeWitness for crate::TypeNe<L, R> {
46    type L = L;
47    type R = R;
48
49    #[cfg(feature = "rust_1_65")]
50    type TypeCtor = crate::type_constructors::TcTypeNe;
51}
52
53impl<L: ?Sized, R: ?Sized> BaseTypeWitness for crate::TypeCmp<L, R> {
54    type L = L;
55    type R = R;
56
57    #[cfg(feature = "rust_1_65")]
58    type TypeCtor = crate::type_constructors::TcTypeCmp;
59}
60
61
62