[−][src]Struct ephemeris::Duration
A time-based amount of time, such as '34.5 seconds'.
Methods
impl Duration
[src]
pub const MIN: Duration
[src]
Constant for a duration with the greatest negative length.
pub const ZERO: Duration
[src]
Constant for a duration of zero length.
pub const MAX: Duration
[src]
Constant for a duration with the greatest positive length.
pub fn of_days(days: i64) -> Duration
[src]
Obtains a Duration
representing a number of standard days.
The seconds are calculated based on the standard definition of a day, where each day is 86,400 seconds. The nanosecond in second field is set to zero.
Parameters
days
: the days in the duration.
Panics
- if the amount of days would overflow the duration.
pub fn of_hours(hours: i64) -> Duration
[src]
Obtains a Duration
representing a number of standard hours.
The seconds are calculated based on the standard definition of an hour, where each hour is 3600 seconds. The nanosecond in second field is set to zero.
Parameters
hours
: the hours in the duration.
Panics
- if the amount of hours would overflow the duration.
pub fn of_minutes(minutes: i64) -> Duration
[src]
Obtains a Duration
representing a number of standard minutes.
The seconds are calculated based on the standard definition of a minute, where each minute is 60 seconds. The nanosecond in second field is set to zero.
Parameters
minutes
: the minutes in the duration.
Panics
- if the amount of minutes would overflow the duration.
pub fn of_seconds_and_adjustment(seconds: i64, nano_adjustment: i64) -> Duration
[src]
Obtains a Duration representing a number of seconds and an adjustment in nanoseconds.
Parameters
seconds
: the seconds in the duration.nano_adjustment
: the adjustment amount from the given second.
Panics
- if the adjusted amount of seconds would overflow the duration.
pub fn of_seconds(seconds: i64) -> Duration
[src]
Obtains a Duration representing a number of seconds.
The nanosecond field will be set to 0.
Parameters
seconds
: the seconds in the duration.
pub fn of_millis(millis: i64) -> Duration
[src]
Obtains a Duration
representing a number of milliseconds.
The seconds and nanoseconds are extracted from the specified milliseconds.
Parameters
millis
: the milliseconds in the duration.
pub fn of_nanos(nanoseconds: i64) -> Duration
[src]
Obtains a Duration
representing a number of nanoseconds.
The seconds and nanoseconds are extracted from the specified nanoseconds.
Parameters
nanos
: the nanos in the duration.
pub const fn nanos(&self) -> u32
[src]
Gets the number of nanoseconds within the second in this duration.
pub const fn seconds(&self) -> i64
[src]
Gets the number of seconds in this duration.
Trait Implementations
impl Clone for Duration
[src]
impl Copy for Duration
[src]
impl Debug for Duration
[src]
impl Default for Duration
[src]
impl Eq for Duration
[src]
impl Hash for Duration
[src]
fn hash<__H: Hasher>(&self, state: &mut __H)
[src]
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
impl Ord for Duration
[src]
fn cmp(&self, other: &Duration) -> Ordering
[src]
fn max(self, other: Self) -> Self
1.21.0[src]
fn min(self, other: Self) -> Self
1.21.0[src]
fn clamp(self, min: Self, max: Self) -> Self
[src]
impl PartialEq<Duration> for Duration
[src]
impl PartialOrd<Duration> for Duration
[src]
fn partial_cmp(&self, other: &Duration) -> Option<Ordering>
[src]
fn lt(&self, other: &Duration) -> bool
[src]
fn le(&self, other: &Duration) -> bool
[src]
fn gt(&self, other: &Duration) -> bool
[src]
fn ge(&self, other: &Duration) -> bool
[src]
impl StructuralEq for Duration
[src]
impl StructuralPartialEq for Duration
[src]
Auto Trait Implementations
impl RefUnwindSafe for Duration
impl Send for Duration
impl Sync for Duration
impl Unpin for Duration
impl UnwindSafe for Duration
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> 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, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,