pub struct DateTime {
pub year: i32,
pub month: u8,
pub day: u8,
pub hour: u8,
pub minute: u8,
pub second: u8,
}Expand description
Represents some time. Can be converted from chrono.
Fields§
§year: i32The years since 0 CE
month: u8The month of the year 1-12
day: u8The day of the month 1-(28|30|31)
hour: u8The hour in the day 0-23
minute: u8The minute in the hour
second: u8The second in the minute
Implementations§
Trait Implementations§
Source§impl<'expr> AsExpression<Nullable<Timestamp>> for &'expr DateTime
impl<'expr> AsExpression<Nullable<Timestamp>> for &'expr DateTime
Source§fn as_expression(self) -> Self::Expression
fn as_expression(self) -> Self::Expression
Perform the conversion
Source§impl AsExpression<Nullable<Timestamp>> for DateTime
impl AsExpression<Nullable<Timestamp>> for DateTime
Source§fn as_expression(self) -> Self::Expression
fn as_expression(self) -> Self::Expression
Perform the conversion
Source§impl<'expr> AsExpression<Timestamp> for &'expr DateTime
impl<'expr> AsExpression<Timestamp> for &'expr DateTime
Source§type Expression = Bound<Timestamp, &'expr DateTime>
type Expression = Bound<Timestamp, &'expr DateTime>
The expression being returned
Source§fn as_expression(self) -> Self::Expression
fn as_expression(self) -> Self::Expression
Perform the conversion
Source§impl AsExpression<Timestamp> for DateTime
impl AsExpression<Timestamp> for DateTime
Source§type Expression = Bound<Timestamp, DateTime>
type Expression = Bound<Timestamp, DateTime>
The expression being returned
Source§fn as_expression(self) -> Self::Expression
fn as_expression(self) -> Self::Expression
Perform the conversion
Source§impl<__ST, __DB> FromSqlRow<__ST, __DB> for DateTime
impl<__ST, __DB> FromSqlRow<__ST, __DB> for DateTime
Source§const FIELDS_NEEDED: usize = 1
const FIELDS_NEEDED: usize = 1
The number of fields that this type will consume. Must be equal to
the number of times you would call
row.take() in build_from_rowSource§impl Ord for DateTime
impl Ord for DateTime
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialOrd for DateTime
impl PartialOrd for DateTime
Source§impl TryFrom<NaiveDateTime> for DateTime
Available on crate feature chrono only.
impl TryFrom<NaiveDateTime> for DateTime
Available on crate feature
chrono only.Source§type Error = TryFromIntError
type Error = TryFromIntError
The type returned in the event of a conversion error.
impl Eq 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 UnsafeUnpin 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> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> IntoSql for T
impl<T> IntoSql for T
Source§fn into_sql<T>(self) -> Self::Expressionwhere
Self: Sized + AsExpression<T>,
fn into_sql<T>(self) -> Self::Expressionwhere
Self: Sized + AsExpression<T>,
Convert
self to an expression for Diesel’s query builder. Read moreSource§fn as_sql<'a, T>(&'a self) -> <&'a Self as AsExpression<T>>::Expressionwhere
&'a Self: AsExpression<T>,
fn as_sql<'a, T>(&'a self) -> <&'a Self as AsExpression<T>>::Expressionwhere
&'a Self: AsExpression<T>,
Convert
&self to an expression for Diesel’s query builder. Read more