File tree Expand file tree Collapse file tree 1 file changed +30
-0
lines changed Expand file tree Collapse file tree 1 file changed +30
-0
lines changed Original file line number Diff line number Diff line change @@ -51,6 +51,36 @@ pub enum MaybeUnset<V> {
5151 Set ( V ) ,
5252}
5353
54+ /// Represents timeuuid (uuid V1) value
55+ #[ derive( Debug , Clone , Copy ) ]
56+ pub struct CqlTimeuuid ( Uuid ) ;
57+
58+ impl std:: str:: FromStr for CqlTimeuuid {
59+ type Err = uuid:: Error ;
60+
61+ fn from_str ( s : & str ) -> Result < Self , Self :: Err > {
62+ Ok ( Self ( Uuid :: from_str ( s) ?) )
63+ }
64+ }
65+
66+ impl AsRef < Uuid > for CqlTimeuuid {
67+ fn as_ref ( & self ) -> & Uuid {
68+ & self . 0
69+ }
70+ }
71+
72+ impl From < CqlTimeuuid > for Uuid {
73+ fn from ( value : CqlTimeuuid ) -> Self {
74+ value. 0
75+ }
76+ }
77+
78+ impl From < Uuid > for CqlTimeuuid {
79+ fn from ( value : Uuid ) -> Self {
80+ Self ( value)
81+ }
82+ }
83+
5484/// Native CQL date representation that allows for a bigger range of dates (-262145-1-1 to 262143-12-31).
5585///
5686/// Represented as number of days since -5877641-06-23 i.e. 2^31 days before unix epoch.
You can’t perform that action at this time.
0 commit comments