Struct CFDuration

Source
pub struct CFDuration {
    pub seconds: i64,
    pub nanoseconds: u32,
    pub calendar: Calendar,
}
Expand description

A CF duration

Fields§

§seconds: i64§nanoseconds: u32§calendar: Calendar

Implementations§

Source§

impl CFDuration

Source

pub fn new(seconds: i64, nanoseconds: i64, calendar: Calendar) -> Self

Source§

impl CFDuration

Source

pub fn calendar(&self) -> Calendar

Returns the calendar

Source

pub fn from_years(years: i64, calendar: Calendar) -> CFDuration

Makes a new Duration with given number of years. Depends on the Calendar definitions found in the CF conventions See also Calendar

Source

pub fn from_months(months: i64, calendar: Calendar) -> CFDuration

Makes a new Duration with given number of months.

Source

pub fn from_weeks(weeks: i64, calendar: Calendar) -> CFDuration

Makes a new Duration with given number of weeks

Source

pub fn from_days(days: i64, calendar: Calendar) -> CFDuration

Makes a new Duration with given number of days

Source

pub fn from_hours(hours: i64, calendar: Calendar) -> CFDuration

Makes a new Duration with given number of hours

Source

pub fn from_minutes(minutes: i64, calendar: Calendar) -> CFDuration

Makes a new Duration with given number of minutes

Source

pub fn from_seconds(seconds: i64, calendar: Calendar) -> CFDuration

Makes a new Duration with given number of seconds

Source

pub fn from_milliseconds(milliseconds: i64, calendar: Calendar) -> CFDuration

Makes a new Duration with given number of milliseconds

Source

pub fn from_microseconds(microseconds: i64, calendar: Calendar) -> CFDuration

Makes a new Duration with given number of microseconds

Source

pub fn from_nanoseconds(nanoseconds: i64, calendar: Calendar) -> CFDuration

Makes a new Duration with given number of nanoseconds

Source

pub fn num_years(&self) -> f64

Return the total number of years in the duration.

Source

pub fn num_months(&self) -> f64

Return the total number of motnhs in the duration.

Source

pub fn num_weeks(&self) -> f64

Return the total number of weeks in the duration.

Source

pub fn num_days(&self) -> f64

Return the total number of days in the duration.

Source

pub fn num_hours(&self) -> f64

Return the total number of hours in the duration.

Source

pub fn num_minutes(&self) -> f64

Return the total number of minutes in the duration.

Source

pub fn num_seconds(&self) -> f64

Return the total number of seconds in the duration.

Source

pub fn num_milliseconds(&self) -> f64

Return the total number of milliseconds in the duration.

Source

pub fn num_microseconds(&self) -> f64

Return the total number of microseconds in the duration.

Source

pub fn num_nanoseconds(&self) -> f64

Return the total number of nanoseconds in the duration.

Trait Implementations§

Source§

impl Add<&CFDuration> for &CFDatetime

Source§

type Output = Result<CFDatetime, Error>

The resulting type after applying the + operator.
Source§

fn add(self, rhs: &CFDuration) -> Self::Output

Performs the + operation. Read more
Source§

impl Add<&CFDuration> for CFDatetime

Source§

type Output = Result<CFDatetime, Error>

The resulting type after applying the + operator.
Source§

fn add(self, rhs: &CFDuration) -> Self::Output

Performs the + operation. Read more
Source§

impl Add<CFDuration> for &CFDatetime

Source§

type Output = Result<CFDatetime, Error>

The resulting type after applying the + operator.
Source§

fn add(self, rhs: CFDuration) -> Self::Output

Performs the + operation. Read more
Source§

impl Add<CFDuration> for CFDatetime

Source§

type Output = Result<CFDatetime, Error>

The resulting type after applying the + operator.
Source§

fn add(self, rhs: CFDuration) -> Self::Output

Performs the + operation. Read more
Source§

impl Add for &CFDuration

Source§

type Output = Result<CFDuration, Error>

The resulting type after applying the + operator.
Source§

fn add(self, rhs: &CFDuration) -> Self::Output

Performs the + operation. Read more
Source§

impl Add for CFDuration

Source§

type Output = Result<CFDuration, Error>

The resulting type after applying the + operator.
Source§

fn add(self, rhs: CFDuration) -> Self::Output

Performs the + operation. Read more
Source§

impl Debug for CFDuration

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Display for CFDuration

Display a CFDuration with te ISO 8601 format of duration.

§Example

CFDuration::from_days(1).__repr__()
assert_eq!(CFDuration::from_days(1).__repr__(),  "P0Y0M1DT0H0M0S");
Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Mul<f32> for &CFDuration

Source§

type Output = CFDuration

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: f32) -> Self::Output

Performs the * operation. Read more
Source§

impl Mul<f32> for CFDuration

Source§

type Output = CFDuration

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: f32) -> Self::Output

Performs the * operation. Read more
Source§

impl Mul<f64> for &CFDuration

Source§

type Output = CFDuration

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: f64) -> Self::Output

Performs the * operation. Read more
Source§

impl Mul<f64> for CFDuration

Source§

type Output = CFDuration

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: f64) -> Self::Output

Performs the * operation. Read more
Source§

impl Mul<i32> for &CFDuration

Source§

type Output = CFDuration

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: i32) -> Self::Output

Performs the * operation. Read more
Source§

impl Mul<i32> for CFDuration

Source§

type Output = CFDuration

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: i32) -> Self::Output

Performs the * operation. Read more
Source§

impl Mul<i64> for &CFDuration

Source§

type Output = CFDuration

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: i64) -> Self::Output

Performs the * operation. Read more
Source§

impl Mul<i64> for CFDuration

Source§

type Output = CFDuration

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: i64) -> Self::Output

Performs the * operation. Read more
Source§

impl Neg for &CFDuration

Source§

type Output = CFDuration

The resulting type after applying the - operator.
Source§

fn neg(self) -> Self::Output

Performs the unary - operation. Read more
Source§

impl Neg for CFDuration

Source§

type Output = CFDuration

The resulting type after applying the - operator.
Source§

fn neg(self) -> Self::Output

Performs the unary - operation. Read more
Source§

impl Sub<&CFDuration> for &CFDatetime

Source§

type Output = Result<CFDatetime, Error>

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: &CFDuration) -> Self::Output

Performs the - operation. Read more
Source§

impl Sub<&CFDuration> for CFDatetime

Source§

type Output = Result<CFDatetime, Error>

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: &CFDuration) -> Self::Output

Performs the - operation. Read more
Source§

impl Sub<CFDuration> for &CFDatetime

Source§

type Output = Result<CFDatetime, Error>

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: CFDuration) -> Self::Output

Performs the - operation. Read more
Source§

impl Sub<CFDuration> for CFDatetime

Source§

type Output = Result<CFDatetime, Error>

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: CFDuration) -> Self::Output

Performs the - operation. Read more
Source§

impl Sub for &CFDuration

Source§

type Output = Result<CFDuration, Error>

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: &CFDuration) -> Self::Output

Performs the - operation. Read more
Source§

impl Sub for CFDuration

Source§

type Output = Result<CFDuration, Error>

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: CFDuration) -> Self::Output

Performs the - operation. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> Ungil for T
where T: Send,