1pub trait TypeAppParam {
2 type Param;
3}
4
5pub trait WithTypeArg<T: ?Sized> {
6 type Type: TypeApp<Self, T>;
7}
8
9pub trait TypeApp<TCon, T>:
10 is_type::Is<Type = <TCon as WithTypeArg<T>>::Type> + TypeAppParam
11where
12 TCon: WithTypeArg<T> + ?Sized,
13 T: ?Sized,
14{
15}
16
17pub struct Ref {}
18pub struct Val {}
19
20pub trait TypeAppMaybeRef<TCon, T, RefT>
24where
25 TCon: WithTypeArg<T> + ?Sized,
26 T: ?Sized,
27 RefT: ?Sized,
28{
29}
30
31impl<TCon, T, TCollection> TypeAppMaybeRef<TCon, T, Val> for TCollection
32where
33 TCollection: TypeApp<TCon, T>,
34 TCon: WithTypeArg<T> + ?Sized,
35 T: ?Sized,
36{
37}
38
39impl<TCon, T, TCollection> TypeAppMaybeRef<TCon, T, Ref> for &TCollection
40where
41 TCollection: TypeApp<TCon, T>,
42 TCon: WithTypeArg<T> + ?Sized,
43 T: ?Sized,
44{
45}