pub enum Interval {
Month(i32),
Microsecond(i64),
}
Variants§
Implementations§
source§impl Interval
impl Interval
pub fn unary_minus(&self) -> Interval
pub fn add(&self, other: &Interval) -> Result<Interval, Error>
pub fn subtract(&self, other: &Interval) -> Result<Interval, Error>
pub fn add_date(&self, date: &NaiveDate) -> Result<NaiveDateTime, Error>
pub fn subtract_from_date( &self, date: &NaiveDate ) -> Result<NaiveDateTime, Error>
pub fn add_timestamp( &self, timestamp: &NaiveDateTime ) -> Result<NaiveDateTime, Error>
pub fn subtract_from_timestamp( &self, timestamp: &NaiveDateTime ) -> Result<NaiveDateTime, Error>
pub fn add_time(&self, time: &NaiveTime) -> Result<NaiveTime, Error>
pub fn subtract_from_time(&self, time: &NaiveTime) -> Result<NaiveTime, Error>
pub fn years(years: i32) -> Interval
pub fn months(months: i32) -> Interval
pub fn extract(&self, field: &DateTimeField) -> Result<Value, Error>
pub fn days(days: i32) -> Interval
pub fn hours(hours: i32) -> Interval
pub fn minutes(minutes: i32) -> Interval
pub fn seconds(seconds: i64) -> Interval
pub fn milliseconds(milliseconds: i64) -> Interval
pub fn microseconds(microseconds: i64) -> Interval
pub fn try_from_str( value: &str, leading_field: Option<DateTimeField>, last_field: Option<DateTimeField> ) -> Result<Interval, Error>
Trait Implementations§
source§impl<'de> Deserialize<'de> for Interval
impl<'de> Deserialize<'de> for Interval
source§fn deserialize<__D>(
__deserializer: __D
) -> Result<Interval, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>( __deserializer: __D ) -> Result<Interval, <__D as Deserializer<'de>>::Error>where __D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl Ord for Interval
impl Ord for Interval
source§impl PartialEq for Interval
impl PartialEq for Interval
source§impl PartialOrd for Interval
impl PartialOrd for Interval
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 Serialize for Interval
impl Serialize for Interval
source§fn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>( &self, __serializer: __S ) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where __S: Serializer,
Serialize this value into the given Serde serializer. Read more
impl Copy for Interval
impl Eq for Interval
impl StructuralEq for Interval
impl StructuralPartialEq for Interval
Auto Trait Implementations§
impl RefUnwindSafe for Interval
impl Send for Interval
impl Sync for Interval
impl Unpin for Interval
impl UnwindSafe for Interval
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<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.