1- use chrono:: { NaiveDate , NaiveDateTime , NaiveTime } ;
1+ use chrono:: { DateTime , NaiveDate , NaiveDateTime , NaiveTime , Utc } ;
2+ use time:: { Date , OffsetDateTime , PrimitiveDateTime , Time } ;
3+ use uuid:: Uuid ;
24
35/// This enum represents a [Null](Value::Null)'s type
46#[ derive( Copy , Clone , Debug , PartialEq , Eq ) ]
@@ -22,11 +24,38 @@ pub enum NullType {
2224 /// binary representation
2325 Binary ,
2426 /// Naive Time representation
25- NaiveTime ,
27+ ChronoNaiveTime ,
2628 /// Naive Date representation
27- NaiveDate ,
29+ ChronoNaiveDate ,
2830 /// Naive DateTime representation
29- NaiveDateTime ,
31+ ChronoNaiveDateTime ,
32+ /// Chrono timezone aware date time representation
33+ ChronoDateTime ,
34+ /// time's date representation
35+ TimeDate ,
36+ /// time's time representation
37+ TimeTime ,
38+ /// time's offset datetime representation
39+ TimeOffsetDateTime ,
40+ /// time's primitive datetime representation
41+ TimePrimitiveDateTime ,
42+ /// Uuid representation
43+ Uuid ,
44+ /// Uuid in hyphenated representation
45+ UuidHyphenated ,
46+ /// Uuid in simple text representation
47+ UuidSimple ,
48+ /// serde_json's Value representation
49+ JsonValue ,
50+ /// Mac address representation
51+ #[ cfg( all( feature = "postgres" , not( any( feature = "mysql" , feature = "sqlite" ) ) ) ) ]
52+ MacAddress ,
53+ /// IP network presentation
54+ #[ cfg( all( feature = "postgres" , not( any( feature = "mysql" , feature = "sqlite" ) ) ) ) ]
55+ IpNetwork ,
56+ /// Bit vec representation
57+ #[ cfg( all( feature = "postgres" , not( any( feature = "mysql" , feature = "sqlite" ) ) ) ) ]
58+ BitVec ,
3059}
3160
3261/**
@@ -66,10 +95,37 @@ pub enum Value<'a> {
6695 F32 ( f32 ) ,
6796 /// binary representation
6897 Binary ( & ' a [ u8 ] ) ,
69- /// Naive Time representation
70- NaiveTime ( NaiveTime ) ,
71- /// Naive Date representation
72- NaiveDate ( NaiveDate ) ,
73- /// Naive DateTime representation
74- NaiveDateTime ( NaiveDateTime ) ,
98+ /// chrono's Naive Time representation
99+ ChronoNaiveTime ( NaiveTime ) ,
100+ /// chrono's Naive Date representation
101+ ChronoNaiveDate ( NaiveDate ) ,
102+ /// chrono's Naive DateTime representation
103+ ChronoNaiveDateTime ( NaiveDateTime ) ,
104+ /// chrono's Timezone aware datetime
105+ ChronoDateTime ( DateTime < Utc > ) ,
106+ /// time's date representation
107+ TimeDate ( Date ) ,
108+ /// time's time representation
109+ TimeTime ( Time ) ,
110+ /// time's offset datetime representation
111+ TimeOffsetDateTime ( OffsetDateTime ) ,
112+ /// time's primitive datetime representation
113+ TimePrimitiveDateTime ( PrimitiveDateTime ) ,
114+ /// Uuid representation
115+ Uuid ( Uuid ) ,
116+ /// Uuid in hyphenated representation
117+ UuidHyphenated ( Uuid ) ,
118+ /// Uuid in simple text representation
119+ UuidSimple ( Uuid ) ,
120+ /// serde_json's Value representation
121+ JsonValue ( & ' a serde_json:: Value ) ,
122+ /// Mac address representation
123+ #[ cfg( all( feature = "postgres" , not( any( feature = "mysql" , feature = "sqlite" ) ) ) ) ]
124+ MacAddress ( [ u8 ; 6 ] ) ,
125+ /// IP network presentation
126+ #[ cfg( all( feature = "postgres" , not( any( feature = "mysql" , feature = "sqlite" ) ) ) ) ]
127+ IpNetwork ( ip_network:: IpNetwork ) ,
128+ /// Bit vec representation
129+ #[ cfg( all( feature = "postgres" , not( any( feature = "mysql" , feature = "sqlite" ) ) ) ) ]
130+ BitVec ( & ' a bit_vec:: BitVec ) ,
75131}
0 commit comments