[−][src]Struct pg_interval::Interval
Fields
months: i32days: i32microseconds: i64Methods
impl Interval[src]
impl Interval[src]
pub fn from_postgres<'a>(iso_str: &'a str) -> Result<Interval, ParseError>[src]
impl Interval[src]
pub fn new(months: i32, days: i32, microseconds: i64) -> Interval[src]
Create a new instance of interval from the months, days, and microseconds.
pub fn to_iso_8601(&self) -> String[src]
Output the interval as iso 8601 compliant string.
pub fn to_postgres(&self) -> String[src]
Output the interval as a postgres interval string.
pub fn to_sql(&self) -> String[src]
Output the interval as a sql compliant interval string.
impl Interval[src]
pub fn checked_add(self, other_interval: Interval) -> Option<Interval>[src]
Checked interval addition. Computes Interval + Interval and None if there
was an overflow.
pub fn add_day_time(
self,
days: i32,
hours: i64,
minutes: i64,
seconds: f64
) -> Interval[src]
self,
days: i32,
hours: i64,
minutes: i64,
seconds: f64
) -> Interval
Shortcut method to add day time part to the interval. Any units smaller than a microsecond will be truncated.
pub fn checked_add_day_time(
self,
days: i32,
hours: i64,
minutes: i64,
seconds: f64
) -> Option<Interval>[src]
self,
days: i32,
hours: i64,
minutes: i64,
seconds: f64
) -> Option<Interval>
Checked day time interval addition. Computes the interval and will return None if a
overflow has occured. Any units smaller than a microsecond will be truncated.
pub fn add_year_month(self, year: i32, months: i32) -> Interval[src]
Adds a year month interval.
pub fn checked_add_year_month(self, year: i32, months: i32) -> Option<Interval>[src]
Checked year month addition. Computes the interval and will return None if a
overflow has occured.
impl Interval[src]
pub fn checked_sub(self, other_interval: Interval) -> Option<Interval>[src]
Checked interval subtraction. Computes Interval - Interval and None if there
was an underflow.
pub fn sub_day_time(
self,
days: i32,
hours: i64,
minutes: i64,
seconds: f64
) -> Interval[src]
self,
days: i32,
hours: i64,
minutes: i64,
seconds: f64
) -> Interval
Shortcut method to subtract day time part to the interval. Any units smaller than a microsecond will be truncated.
pub fn checked_sub_day_time(
self,
days: i32,
hours: i64,
minutes: i64,
seconds: f64
) -> Option<Interval>[src]
self,
days: i32,
hours: i64,
minutes: i64,
seconds: f64
) -> Option<Interval>
Checked day time subtraction. Computes the interval and will return None if a
overflow/underflow has occured. Any units smaller than a microsecond will be truncated.
pub fn sub_year_month(self, year: i32, months: i32) -> Interval[src]
Subtracts a year month interval.
pub fn checked_sub_year_month(self, year: i32, months: i32) -> Option<Interval>[src]
Checked year month subtraction. Computes the interval and will return None if a
overflow has occured.
Trait Implementations
impl Clone for Interval[src]
fn clone(&self) -> Interval[src]
fn clone_from(&mut self, source: &Self)1.0.0[src]
Performs copy-assignment from source. Read more
impl PartialEq<Interval> for Interval[src]
impl Eq for Interval[src]
impl Copy for Interval[src]
impl Add<Interval> for Interval[src]
type Output = Interval
The resulting type after applying the + operator.
fn add(self, other_interval: Interval) -> Interval[src]
impl Sub<Interval> for Interval[src]
type Output = Interval
The resulting type after applying the - operator.
fn sub(self, other_interval: Interval) -> Interval[src]
impl Debug for Interval[src]
impl ToSql for Interval[src]
fn to_sql(
&self,
_: &Type,
out: &mut Vec<u8>
) -> Result<IsNull, Box<dyn Error + Sync + Send>>[src]
&self,
_: &Type,
out: &mut Vec<u8>
) -> Result<IsNull, Box<dyn Error + Sync + Send>>
fn accepts(ty: &Type) -> bool[src]
fn to_sql_checked(
&self,
ty: &Type,
out: &mut Vec<u8>
) -> Result<IsNull, Box<dyn Error + Sync + Send>>
&self,
ty: &Type,
out: &mut Vec<u8>
) -> Result<IsNull, Box<dyn Error + Sync + Send>>
impl FromSql for Interval[src]
fn from_sql(
_: &Type,
raw: &[u8]
) -> Result<Interval, Box<dyn Error + Sync + Send>>[src]
_: &Type,
raw: &[u8]
) -> Result<Interval, Box<dyn Error + Sync + Send>>
fn accepts(ty: &Type) -> bool[src]
fn from_sql_null(
ty: &Type
) -> Result<Self, Box<dyn Error + 'static + Sync + Send>>
ty: &Type
) -> Result<Self, Box<dyn Error + 'static + Sync + Send>>
Creates a new value of this type from a NULL SQL value. Read more
fn from_sql_nullable(
ty: &Type,
raw: Option<&[u8]>
) -> Result<Self, Box<dyn Error + 'static + Sync + Send>>
ty: &Type,
raw: Option<&[u8]>
) -> Result<Self, Box<dyn Error + 'static + Sync + Send>>
A convenience function that delegates to from_sql and from_sql_null depending on the value of raw. Read more
Auto Trait Implementations
Blanket Implementations
impl<T, U> Into for T where
U: From<T>, [src]
U: From<T>,
impl<T> From for T[src]
impl<T> ToOwned for T where
T: Clone, [src]
T: Clone,
impl<T, U> TryFrom for T where
U: Into<T>, [src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]
impl<T> Borrow for T where
T: ?Sized, [src]
T: ?Sized,
impl<T> BorrowMut for T where
T: ?Sized, [src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T[src]
impl<T, U> TryInto for T where
U: TryFrom<T>, [src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]
impl<T> Any for T where
T: 'static + ?Sized, [src]
T: 'static + ?Sized,
impl<T> Same for T
type Output = T
Should always be Self