pub struct GoDuration(pub i64);Expand description
A duration as signed nanoseconds.
Tuple Fields§
§0: i64Implementations§
Source§impl GoDuration
impl GoDuration
Sourcepub const NANOSECOND: GoDuration
pub const NANOSECOND: GoDuration
One nanosecond.
Sourcepub const MICROSECOND: GoDuration
pub const MICROSECOND: GoDuration
One microsecond.
Sourcepub const MILLISECOND: GoDuration
pub const MILLISECOND: GoDuration
One millisecond.
Sourcepub const SECOND: GoDuration
pub const SECOND: GoDuration
One second.
Sourcepub const MINUTE: GoDuration
pub const MINUTE: GoDuration
One minute.
Sourcepub const HOUR: GoDuration
pub const HOUR: GoDuration
One hour.
Sourcepub const fn from_secs(s: i64) -> GoDuration
pub const fn from_secs(s: i64) -> GoDuration
s seconds, saturating at the i64 range.
Sourcepub fn from_std(d: Duration) -> GoDuration
pub fn from_std(d: Duration) -> GoDuration
Saturates at i64::MAX nanoseconds.
Trait Implementations§
Source§impl Clone for GoDuration
impl Clone for GoDuration
impl Copy for GoDuration
Source§impl Debug for GoDuration
impl Debug for GoDuration
Source§impl Default for GoDuration
impl Default for GoDuration
Source§impl Display for GoDuration
Displays as go_format_duration (e.g. 1m30s).
impl Display for GoDuration
Displays as go_format_duration (e.g. 1m30s).
impl Eq for GoDuration
Source§impl Hash for GoDuration
impl Hash for GoDuration
Source§impl Ord for GoDuration
impl Ord for GoDuration
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
1.21.0 (const: unstable) · Source§fn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the minimum of two values. Read more
Source§impl PartialEq for GoDuration
impl PartialEq for GoDuration
Source§impl PartialOrd for GoDuration
impl PartialOrd for GoDuration
impl StructuralPartialEq for GoDuration
Auto Trait Implementations§
impl Forget for GoDuration
impl Freeze for GoDuration
impl Move for GoDuration
impl RefUnwindSafe for GoDuration
impl Send for GoDuration
impl Sync for GoDuration
impl Unpin for GoDuration
impl UnsafeUnpin for GoDuration
impl UnwindSafe for GoDuration
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