pub struct Timestamp(/* private fields */);Implementations§
source§impl Timestamp
impl Timestamp
pub fn abs_diff(self, other: Timestamp) -> Duration
pub fn as_secs(self) -> u64
pub fn from_secs(value: u64) -> Self
pub fn as_secs_f64(self) -> f64
pub fn from_secs_f64(value: f64) -> Self
pub fn as_secs_f32(self) -> f32
pub fn from_secs_f32(value: f32) -> Self
pub fn as_micros(self) -> u128
pub fn from_micros(value: u64) -> Self
pub fn as_millis(self) -> u128
pub fn from_millis(value: u64) -> Self
pub fn as_nanos(self) -> u128
pub fn from_nanos(value: u64) -> Self
pub fn as_duration(self) -> Duration
source§impl Timestamp
impl Timestamp
pub fn try_into_naivedatetime(self) -> Result<NaiveDateTime, Error>
pub fn try_into_datetime_local(self) -> Result<DateTime<Local>, Error>
pub fn try_into_datetime_utc(self) -> Result<DateTime<Utc>, Error>
Trait Implementations§
source§impl<'de> Deserialize<'de> for Timestamp
impl<'de> Deserialize<'de> for Timestamp
source§fn deserialize<D>(deserializer: D) -> Result<Timestamp, D::Error>where
D: Deserializer<'de>,
fn deserialize<D>(deserializer: D) -> Result<Timestamp, D::Error>where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl Encode<'_, Postgres> for Timestamp
impl Encode<'_, Postgres> for Timestamp
source§fn encode_by_ref(&self, buf: &mut PgArgumentBuffer) -> IsNull
fn encode_by_ref(&self, buf: &mut PgArgumentBuffer) -> IsNull
fn size_hint(&self) -> usize
§fn encode(self, buf: &mut <DB as HasArguments<'q>>::ArgumentBuffer) -> IsNullwhere
Self: Sized,
fn encode(self, buf: &mut <DB as HasArguments<'q>>::ArgumentBuffer) -> IsNullwhere
Self: Sized,
Writes the value of
self into buf in the expected format for the database.fn produces(&self) -> Option<<DB as Database>::TypeInfo>
source§impl<'q> Encode<'q, Sqlite> for Timestamp
impl<'q> Encode<'q, Sqlite> for Timestamp
source§fn encode_by_ref(&self, args: &mut Vec<SqliteArgumentValue<'q>>) -> IsNull
fn encode_by_ref(&self, args: &mut Vec<SqliteArgumentValue<'q>>) -> IsNull
§fn encode(self, buf: &mut <DB as HasArguments<'q>>::ArgumentBuffer) -> IsNullwhere
Self: Sized,
fn encode(self, buf: &mut <DB as HasArguments<'q>>::ArgumentBuffer) -> IsNullwhere
Self: Sized,
Writes the value of
self into buf in the expected format for the database.fn produces(&self) -> Option<<DB as Database>::TypeInfo>
fn size_hint(&self) -> usize
source§impl Ord for Timestamp
impl Ord for Timestamp
source§impl PartialEq for Timestamp
impl PartialEq for Timestamp
source§impl PartialOrd for Timestamp
impl PartialOrd for Timestamp
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self and other) and is used by the <=
operator. Read moresource§impl TryFrom<NaiveDateTime> for Timestamp
impl TryFrom<NaiveDateTime> for Timestamp
source§impl TryFrom<Timestamp> for NaiveDateTime
impl TryFrom<Timestamp> for NaiveDateTime
impl Copy for Timestamp
impl Eq for Timestamp
impl StructuralPartialEq for Timestamp
Auto Trait Implementations§
impl RefUnwindSafe for Timestamp
impl Send for Timestamp
impl Sync for Timestamp
impl Unpin for Timestamp
impl UnwindSafe for Timestamp
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
§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.