@@ -5,11 +5,54 @@ use crate::Refined;
55/// A type that holds a value satisfying the `LengthGreaterRule`
66pub type LengthGreater < const THAN : usize , ITEM > = Refined < LengthGreaterRule < THAN , ITEM > > ;
77
8+ /// A type that holds a value satisfying the `LengthGreaterVecRule`
9+ pub type LengthGreaterVec < const THAN : usize , ITEM > = Refined < LengthGreaterVecRule < THAN , ITEM > > ;
10+
11+ /// A type that holds a value satisfying the `LengthGreaterVecDequeRule`
12+ pub type LengthGreaterVecDeque < const THAN : usize , ITEM > =
13+ Refined < LengthGreaterVecDequeRule < THAN , ITEM > > ;
14+
15+ /// A type that holds a value satisfying the `LengthGreaterHashMapRule`
16+ pub type LengthGreaterHashMap < const THAN : usize , K , V > =
17+ Refined < LengthGreaterHashMapRule < THAN , K , V > > ;
18+
19+ /// A type that holds a value satisfying the `LengthGreaterHashSetRule`
20+ pub type LengthGreaterHashSet < const THAN : usize , ITEM > =
21+ Refined < LengthGreaterHashSetRule < THAN , ITEM > > ;
22+
23+ /// A type that holds a value satisfying the `LengthGreaterStringRule`
24+ pub type LengthGreaterString < const THAN : usize > = LengthGreater < THAN , String > ;
25+
26+ /// A type that holds a value satisfying the `LengthGreaterStrRule`
27+ pub type LengthGreaterStr < ' a , const THAN : usize > = LengthGreater < THAN , & ' a str > ;
28+
829/// Rule where the input `ITEM` has a length greater than `THAN`
30+ #[ derive( Debug , Clone , Copy , Eq , PartialEq , Ord , PartialOrd ) ]
931pub struct LengthGreaterRule < const THAN : usize , ITEM > {
1032 _phantom : std:: marker:: PhantomData < ITEM > ,
1133}
1234
35+ /// Rule where the input `Vec` has a length greater than `THAN`
36+ pub type LengthGreaterVecRule < const THAN : usize , ITEM > = LengthGreaterRule < THAN , Vec < ITEM > > ;
37+
38+ /// Rule where the input `VecDeque` has a length greater than `THAN`
39+ pub type LengthGreaterVecDequeRule < const THAN : usize , ITEM > =
40+ LengthGreaterRule < THAN , std:: collections:: VecDeque < ITEM > > ;
41+
42+ /// Rule where the input `HashMap` has a length greater than `THAN`
43+ pub type LengthGreaterHashMapRule < const THAN : usize , K , V > =
44+ LengthGreaterRule < THAN , std:: collections:: HashMap < K , V > > ;
45+
46+ /// Rule where the input `HashSet` has a length greater than `THAN`
47+ pub type LengthGreaterHashSetRule < const THAN : usize , ITEM > =
48+ LengthGreaterRule < THAN , std:: collections:: HashSet < ITEM > > ;
49+
50+ /// Rule where the input `String` has a length greater than `THAN`
51+ pub type LengthGreaterStringRule < const THAN : usize > = LengthGreaterRule < THAN , String > ;
52+
53+ /// Rule where the input `&str` has a length greater than `THAN`
54+ pub type LengthGreaterStrRule < ' a , const THAN : usize > = LengthGreaterRule < THAN , & ' a str > ;
55+
1356impl < const THAN : usize , ITEM : LengthDefinition > Rule for LengthGreaterRule < THAN , ITEM > {
1457 type Item = ITEM ;
1558 fn validate ( target : Self :: Item ) -> Result < Self :: Item , Error < Self :: Item > > {
0 commit comments