Struct sqldatetime::Timestamp [−][src]
#[repr(transparent)]pub struct Timestamp(_);
Expand description
Timestamp represents a valid time at a valid Gregorian date.
This is an SQL TIMESTAMP
value, with the specification of fractional seconds to a precision of microseconds.
Implementations
impl Timestamp
[src]
impl Timestamp
[src]pub const MIN: Self
[src]
pub const MIN: Self
[src]The smallest timestamp that can be represented by Date
, i.e. 0001-01-01 00:00:00.000000
.
pub const MAX: Self
[src]
pub const MAX: Self
[src]The largest timestamp that can be represented by Date
, i.e. 9999-12-31 23:59:59.999999
.
pub const fn new(date: Date, time: Time) -> Self
[src]
pub const fn new(date: Date, time: Time) -> Self
[src]Creates a new Timestamp
from a date and a time.
pub const unsafe fn from_usecs_unchecked(usecs: i64) -> Self
[src]
pub const unsafe fn from_usecs_unchecked(usecs: i64) -> Self
[src]Creates a Timestamp
from the given microseconds from Unix Epoch without checking validity.
Safety
This function is unsafe because the microsecond value is not checked for validity! Before using it, check that the value is correct.
pub fn format<S: AsRef<str>>(self, fmt: S) -> Result<impl Display, Error>
[src]
pub fn format<S: AsRef<str>>(self, fmt: S) -> Result<impl Display, Error>
[src]Formats Timestamp
by given format string.
pub fn parse<S1: AsRef<str>, S2: AsRef<str>>(
input: S1,
fmt: S2
) -> Result<Self, Error>
[src]
pub fn parse<S1: AsRef<str>, S2: AsRef<str>>(
input: S1,
fmt: S2
) -> Result<Self, Error>
[src]Parses Timestamp
from given string and format.
pub const fn try_from_usecs(usecs: i64) -> Result<Self, Error>
[src]
pub const fn try_from_usecs(usecs: i64) -> Result<Self, Error>
[src]Creates a Timestamp
from the given microseconds from Unix Epoch
pub const fn add_interval_dt(
self,
interval: IntervalDT
) -> Result<Timestamp, Error>
[src]
pub const fn add_interval_dt(
self,
interval: IntervalDT
) -> Result<Timestamp, Error>
[src]Timestamp
adds IntervalDT
pub fn add_interval_ym(self, interval: IntervalYM) -> Result<Timestamp, Error>
[src]
pub fn add_interval_ym(self, interval: IntervalYM) -> Result<Timestamp, Error>
[src]Timestamp
adds IntervalYM
pub const fn sub_date(self, date: Date) -> IntervalDT
[src]
pub const fn sub_date(self, date: Date) -> IntervalDT
[src]Timestamp
subtracts Date
pub const fn sub_timestamp(self, timestamp: Timestamp) -> IntervalDT
[src]
pub const fn sub_timestamp(self, timestamp: Timestamp) -> IntervalDT
[src]Timestamp
subtracts Timestamp
pub const fn sub_interval_dt(
self,
interval: IntervalDT
) -> Result<Timestamp, Error>
[src]
pub const fn sub_interval_dt(
self,
interval: IntervalDT
) -> Result<Timestamp, Error>
[src]Timestamp
subtracts IntervalDT
pub fn sub_interval_ym(self, interval: IntervalYM) -> Result<Timestamp, Error>
[src]
pub fn sub_interval_ym(self, interval: IntervalYM) -> Result<Timestamp, Error>
[src]Timestamp
subtracts IntervalYM
impl Timestamp
[src]
impl Timestamp
[src]pub const fn oracle_sub_date(self, date: Date) -> IntervalDT
[src]
pub const fn oracle_sub_date(self, date: Date) -> IntervalDT
[src]Timestamp
subtracts Date
Trait Implementations
impl<'de> Deserialize<'de> for Timestamp
[src]
impl<'de> Deserialize<'de> for Timestamp
[src]serde
only.fn deserialize<D>(deserializer: D) -> Result<Self, D::Error> where
D: Deserializer<'de>,
[src]
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error> where
D: Deserializer<'de>,
[src]Deserialize this value from the given Serde deserializer. Read more
impl Ord for Timestamp
[src]
impl Ord for Timestamp
[src]impl PartialOrd<Date> for Timestamp
[src]
impl PartialOrd<Date> for Timestamp
[src]fn partial_cmp(&self, other: &Date) -> Option<Ordering>
[src]
fn partial_cmp(&self, other: &Date) -> Option<Ordering>
[src]This method returns an ordering between self
and other
values if one exists. Read more
#[must_use]fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn lt(&self, other: &Rhs) -> bool
1.0.0[src]This method tests less than (for self
and other
) and is used by the <
operator. Read more
#[must_use]fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn le(&self, other: &Rhs) -> bool
1.0.0[src]This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
impl PartialOrd<Date> for Timestamp
[src]
impl PartialOrd<Date> for Timestamp
[src]fn partial_cmp(&self, other: &Date) -> Option<Ordering>
[src]
fn partial_cmp(&self, other: &Date) -> Option<Ordering>
[src]This method returns an ordering between self
and other
values if one exists. Read more
#[must_use]fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn lt(&self, other: &Rhs) -> bool
1.0.0[src]This method tests less than (for self
and other
) and is used by the <
operator. Read more
#[must_use]fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn le(&self, other: &Rhs) -> bool
1.0.0[src]This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
impl PartialOrd<Timestamp> for Date
[src]
impl PartialOrd<Timestamp> for Date
[src]fn partial_cmp(&self, other: &Timestamp) -> Option<Ordering>
[src]
fn partial_cmp(&self, other: &Timestamp) -> Option<Ordering>
[src]This method returns an ordering between self
and other
values if one exists. Read more
#[must_use]fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn lt(&self, other: &Rhs) -> bool
1.0.0[src]This method tests less than (for self
and other
) and is used by the <
operator. Read more
#[must_use]fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn le(&self, other: &Rhs) -> bool
1.0.0[src]This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
impl PartialOrd<Timestamp> for Timestamp
[src]
impl PartialOrd<Timestamp> for Timestamp
[src]fn partial_cmp(&self, other: &Timestamp) -> Option<Ordering>
[src]
fn partial_cmp(&self, other: &Timestamp) -> Option<Ordering>
[src]This method returns an ordering between self
and other
values if one exists. Read more
#[must_use]fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn lt(&self, other: &Rhs) -> bool
1.0.0[src]This method tests less than (for self
and other
) and is used by the <
operator. Read more
#[must_use]fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn le(&self, other: &Rhs) -> bool
1.0.0[src]This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
impl PartialOrd<Timestamp> for Date
[src]
impl PartialOrd<Timestamp> for Date
[src]fn partial_cmp(&self, other: &Timestamp) -> Option<Ordering>
[src]
fn partial_cmp(&self, other: &Timestamp) -> Option<Ordering>
[src]This method returns an ordering between self
and other
values if one exists. Read more
#[must_use]fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn lt(&self, other: &Rhs) -> bool
1.0.0[src]This method tests less than (for self
and other
) and is used by the <
operator. Read more
#[must_use]fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn le(&self, other: &Rhs) -> bool
1.0.0[src]This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
impl Copy for Timestamp
[src]
impl Eq for Timestamp
[src]
impl StructuralEq for Timestamp
[src]
impl StructuralPartialEq for Timestamp
[src]
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
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]pub fn borrow_mut(&mut self) -> &mut T
[src]
pub fn borrow_mut(&mut self) -> &mut T
[src]Mutably borrows from an owned value. Read more
impl<T> ToOwned for T where
T: Clone,
[src]
impl<T> ToOwned for T where
T: Clone,
[src]type Owned = T
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn to_owned(&self) -> T
[src]Creates owned data from borrowed data, usually by cloning. Read more
pub fn clone_into(&self, target: &mut T)
[src]
pub fn clone_into(&self, target: &mut T)
[src]🔬 This is a nightly-only experimental API. (toowned_clone_into
)
recently added
Uses borrowed data to replace owned data, usually by cloning. Read more
impl<T> DeserializeOwned for T where
T: for<'de> Deserialize<'de>,
[src]
T: for<'de> Deserialize<'de>,