Struct sqldatetime::IntervalDT [−][src]
#[repr(transparent)]pub struct IntervalDT(_);
Expand description
Day-Time Interval
represents the duration of a period of time,
has an interval precision that includes DAY, HOUR, MINUTE, SECOND, MICROSECOND.
Implementations
impl IntervalDT
[src]
impl IntervalDT
[src]pub const MIN: Self
[src]
pub const MIN: Self
[src]The smallest interval that can be represented by IntervalDT
, i.e. -100000000 00:00:00.000000
.
pub const MAX: Self
[src]
pub const MAX: Self
[src]The largest interval that can be represented by IntervalDT
, i.e. 100000000 00:00:00.000000
.
pub const unsafe fn from_dhms_unchecked(
day: u32,
hour: u32,
minute: u32,
sec: u32,
usec: u32
) -> Self
[src]
pub const unsafe fn from_dhms_unchecked(
day: u32,
hour: u32,
minute: u32,
sec: u32,
usec: u32
) -> Self
[src]Creates a IntervalDT
from the given day, hour, minute, second and microsecond.
Safety
This function is unsafe because the values are not checked for validity! Before using it, check that the values are all correct.
pub const fn try_from_dhms(
day: u32,
hour: u32,
minute: u32,
sec: u32,
usec: u32
) -> Result<Self, Error>
[src]
pub const fn try_from_dhms(
day: u32,
hour: u32,
minute: u32,
sec: u32,
usec: u32
) -> Result<Self, Error>
[src]Creates a IntervalDT
from the given day, hour, minute, second and microsecond.
pub const fn is_valid(
day: u32,
hour: u32,
minute: u32,
sec: u32,
usec: u32
) -> bool
[src]
pub const fn is_valid(
day: u32,
hour: u32,
minute: u32,
sec: u32,
usec: u32
) -> bool
[src]Checks if the given day, hour, minute, second and microsecond fields are valid.
pub const fn extract(self) -> (Sign, u32, u32, u32, u32, u32)
[src]
pub const fn extract(self) -> (Sign, u32, u32, u32, u32, u32)
[src]Extracts (day, hour, minute, second, microsecond)
from the interval.
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 IntervalDT
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 IntervalDT
from given string and format.
pub const fn add_interval_dt(
self,
interval: IntervalDT
) -> Result<IntervalDT, Error>
[src]
pub const fn add_interval_dt(
self,
interval: IntervalDT
) -> Result<IntervalDT, Error>
[src]IntervalDT
adds IntervalDT
pub const fn sub_interval_dt(
self,
interval: IntervalDT
) -> Result<IntervalDT, Error>
[src]
pub const fn sub_interval_dt(
self,
interval: IntervalDT
) -> Result<IntervalDT, Error>
[src]IntervalDT
subtracts IntervalDT
Trait Implementations
impl Clone for IntervalDT
[src]
impl Clone for IntervalDT
[src]fn clone(&self) -> IntervalDT
[src]
fn clone(&self) -> IntervalDT
[src]Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]Performs copy-assignment from source
. Read more
impl DateTime for IntervalDT
[src]
impl DateTime for IntervalDT
[src]impl Debug for IntervalDT
[src]
impl Debug for IntervalDT
[src]impl Hash for IntervalDT
[src]
impl Hash for IntervalDT
[src]impl Neg for IntervalDT
[src]
impl Neg for IntervalDT
[src]impl Ord for IntervalDT
[src]
impl Ord for IntervalDT
[src]impl PartialEq<IntervalDT> for IntervalDT
[src]
impl PartialEq<IntervalDT> for IntervalDT
[src]fn eq(&self, other: &IntervalDT) -> bool
[src]
fn eq(&self, other: &IntervalDT) -> bool
[src]This method tests for self
and other
values to be equal, and is used
by ==
. Read more
fn ne(&self, other: &IntervalDT) -> bool
[src]
fn ne(&self, other: &IntervalDT) -> bool
[src]This method tests for !=
.
impl PartialEq<IntervalDT> for Time
[src]
impl PartialEq<IntervalDT> for Time
[src]impl PartialEq<Time> for IntervalDT
[src]
impl PartialEq<Time> for IntervalDT
[src]impl PartialOrd<IntervalDT> for IntervalDT
[src]
impl PartialOrd<IntervalDT> for IntervalDT
[src]fn partial_cmp(&self, other: &IntervalDT) -> Option<Ordering>
[src]
fn partial_cmp(&self, other: &IntervalDT) -> 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<IntervalDT> for Time
[src]
impl PartialOrd<IntervalDT> for Time
[src]fn partial_cmp(&self, other: &IntervalDT) -> Option<Ordering>
[src]
fn partial_cmp(&self, other: &IntervalDT) -> 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<Time> for IntervalDT
[src]
impl PartialOrd<Time> for IntervalDT
[src]fn partial_cmp(&self, other: &Time) -> Option<Ordering>
[src]
fn partial_cmp(&self, other: &Time) -> 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 IntervalDT
[src]
impl Eq for IntervalDT
[src]
impl StructuralEq for IntervalDT
[src]
impl StructuralPartialEq for IntervalDT
[src]
Auto Trait Implementations
impl RefUnwindSafe for IntervalDT
impl Send for IntervalDT
impl Sync for IntervalDT
impl Unpin for IntervalDT
impl UnwindSafe for IntervalDT
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