pub struct Duration(/* private fields */);Implementations§
Source§impl Duration
impl Duration
Sourcepub fn create(
years: i64,
months: i64,
weeks: i64,
days: i64,
hours: i64,
minutes: i64,
seconds: i64,
milliseconds: i64,
microseconds: f64,
nanoseconds: f64,
) -> Result<Box<Self>, TemporalError>
pub fn create( years: i64, months: i64, weeks: i64, days: i64, hours: i64, minutes: i64, seconds: i64, milliseconds: i64, microseconds: f64, nanoseconds: f64, ) -> Result<Box<Self>, TemporalError>
Temporary API until v8 can move off of it
pub fn try_new( years: i64, months: i64, weeks: i64, days: i64, hours: i64, minutes: i64, seconds: i64, milliseconds: i64, microseconds: f64, nanoseconds: f64, ) -> Result<Box<Self>, TemporalError>
pub fn from_partial_duration( partial: PartialDuration, ) -> Result<Box<Self>, TemporalError>
pub fn from_utf8(s: &DiplomatStr) -> Result<Box<Self>, TemporalError>
pub fn from_utf16(s: &DiplomatStr16) -> Result<Box<Self>, TemporalError>
pub fn is_time_within_range(&self) -> bool
pub fn years(&self) -> i64
pub fn months(&self) -> i64
pub fn weeks(&self) -> i64
pub fn days(&self) -> i64
pub fn hours(&self) -> i64
pub fn minutes(&self) -> i64
pub fn seconds(&self) -> i64
pub fn milliseconds(&self) -> i64
pub fn microseconds(&self) -> f64
pub fn nanoseconds(&self) -> f64
pub fn sign(&self) -> Sign
pub fn is_zero(&self) -> bool
pub fn abs(&self) -> Box<Self>
pub fn negated(&self) -> Box<Self>
pub fn add(&self, other: &Self) -> Result<Box<Self>, TemporalError>
pub fn subtract(&self, other: &Self) -> Result<Box<Self>, TemporalError>
pub fn to_string( &self, options: ToStringRoundingOptions, write: &mut DiplomatWrite, ) -> Result<(), TemporalError>
pub fn round( &self, options: RoundingOptions, relative_to: RelativeTo<'_>, ) -> Result<Box<Self>, TemporalError>
pub fn round_with_provider<'p>( &self, options: RoundingOptions, relative_to: RelativeTo<'_>, p: &Provider<'p>, ) -> Result<Box<Self>, TemporalError>
pub fn compare( &self, other: &Self, relative_to: RelativeTo<'_>, ) -> Result<i8, TemporalError>
pub fn compare_with_provider<'p>( &self, other: &Self, relative_to: RelativeTo<'_>, p: &Provider<'p>, ) -> Result<i8, TemporalError>
pub fn total( &self, unit: Unit, relative_to: RelativeTo<'_>, ) -> Result<f64, TemporalError>
pub fn total_with_provider<'p>( &self, unit: Unit, relative_to: RelativeTo<'_>, p: &Provider<'p>, ) -> Result<f64, TemporalError>
pub fn clone(&self) -> Box<Self>
Auto Trait Implementations§
impl Freeze for Duration
impl RefUnwindSafe for Duration
impl Send for Duration
impl Sync for Duration
impl Unpin for Duration
impl UnsafeUnpin for Duration
impl UnwindSafe for Duration
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