pub enum DateTime {
Date(NaiveDate),
Time(NaiveTime),
DateTime(DateTime<Utc>),
}Expand description
Enum representing a date, time, or date-time value.
§Variants
Date(NaiveDate)- Represents a date without timezone information.Time(NaiveTime)- Represents a time without date and timezone information.DateTime(ChDateTime<chrono::Utc>)- Represents a date-time with timezone information.
Variants§
Trait Implementations§
Source§impl DateTimeBehavior for DateTime
impl DateTimeBehavior for DateTime
fn as_date(&self) -> Option<&NaiveDate>
fn as_time(&self) -> Option<&NaiveTime>
fn as_date_time(&self) -> Option<&DateTime<Utc>>
fn year(&self) -> Option<i32>
fn month(&self) -> Option<u32>
fn day(&self) -> Option<u32>
fn hour(&self) -> Option<u32>
fn minute(&self) -> Option<u32>
fn second(&self) -> Option<u32>
fn timestamp(&self) -> Option<i64>
fn timezone(&self) -> Option<Utc>
fn to_iso8601(&self) -> String
fn to_rfc3339(&self) -> String
fn add_duration(&self, duration: TimeDelta) -> Option<DateTime>
fn subtract_duration(&self, duration: TimeDelta) -> Option<DateTime>
fn duration_between(&self, other: &DateTime) -> Option<TimeDelta>
fn from_ymd_opt(year: i32, month: u32, day: u32) -> DateTime
fn with_ymd_and_hms( year: i32, month: u32, day: u32, hour: u32, min: u32, sec: u32, ) -> DateTime
fn now() -> DateTime
Source§impl PartialOrd for DateTime
impl PartialOrd for DateTime
Source§impl ToValueBehavior for DateTime
impl ToValueBehavior for DateTime
impl PrimitiveType for DateTime
impl StructuralPartialEq for DateTime
Auto Trait Implementations§
impl Freeze for DateTime
impl RefUnwindSafe for DateTime
impl Send for DateTime
impl Sync for DateTime
impl Unpin for DateTime
impl UnwindSafe for DateTime
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
Source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request