pub type Time = ClockTime;
Aliased Type§
struct Time(u64);
Fields§
§0: u64
Implementations
Source§impl ClockTime
impl ClockTime
pub const SECOND: ClockTime
pub const MSECOND: ClockTime
pub const USECOND: ClockTime
pub const NSECOND: ClockTime
pub const MAX: ClockTime
pub const fn hours(self) -> u64
pub const fn minutes(self) -> u64
pub const fn seconds(self) -> u64
pub fn seconds_f32(self) -> f32
pub fn seconds_f64(self) -> f64
pub const fn mseconds(self) -> u64
pub const fn useconds(self) -> u64
pub const fn nseconds(self) -> u64
Sourcepub const fn from_seconds(seconds: u64) -> Self
pub const fn from_seconds(seconds: u64) -> Self
Builds a new ClockTime
which value is the given number of seconds.
§Panics
Panics if the resulting duration in nanoseconds exceeds the u64
range.
Sourcepub fn try_from_seconds_f32(seconds: f32) -> Result<Self, TryFromFloatSecsError>
pub fn try_from_seconds_f32(seconds: f32) -> Result<Self, TryFromFloatSecsError>
Builds a new ClockTime
which value is the given number of seconds.
Returns an error if seconds is negative, infinite or NaN, or
the resulting duration in nanoseconds exceeds the u64
range.
Sourcepub fn from_seconds_f32(seconds: f32) -> Self
pub fn from_seconds_f32(seconds: f32) -> Self
Builds a new ClockTime
which value is the given number of seconds.
§Panics
Panics if seconds is negative, infinite or NaN, or the resulting duration
in nanoseconds exceeds the u64
range.
Sourcepub fn try_from_seconds_f64(seconds: f64) -> Result<Self, TryFromFloatSecsError>
pub fn try_from_seconds_f64(seconds: f64) -> Result<Self, TryFromFloatSecsError>
Builds a new ClockTime
which value is the given number of seconds.
Returns an error if seconds is negative, infinite or NaN, or
the resulting duration in nanoseconds exceeds the u64
range.
Sourcepub fn from_seconds_f64(seconds: f64) -> Self
pub fn from_seconds_f64(seconds: f64) -> Self
Builds a new ClockTime
which value is the given number of seconds.
§Panics
Panics if seconds is negative, infinite or NaN, or the resulting duration
in nanoseconds exceeds the u64
range.
Sourcepub const fn from_mseconds(mseconds: u64) -> Self
pub const fn from_mseconds(mseconds: u64) -> Self
Builds a new ClockTime
which value is the given number of milliseconds.
§Panics
Panics if the resulting duration in nanoseconds exceeds the u64
range.
Sourcepub const fn from_useconds(useconds: u64) -> Self
pub const fn from_useconds(useconds: u64) -> Self
Builds a new ClockTime
which value is the given number of microseconds.
§Panics
Panics if the resulting duration in nanoseconds exceeds the u64
range.
Sourcepub const fn from_nseconds(nseconds: u64) -> Self
pub const fn from_nseconds(nseconds: u64) -> Self
Builds a new ClockTime
which value is the given number of nanoseconds.
§Panics
Panics if the requested duration equals GST_CLOCK_TIME_NONE
(u64::MAX
).
Source§impl ClockTime
impl ClockTime
pub const fn checked_add(self, rhs: Self) -> Option<Self>
pub const fn saturating_add(self, rhs: Self) -> Self
pub fn overflowing_add(self, rhs: Self) -> (Self, bool)
pub fn wrapping_add(self, rhs: Self) -> Self
pub const fn checked_sub(self, rhs: Self) -> Option<Self>
pub const fn saturating_sub(self, rhs: Self) -> Self
pub const fn overflowing_sub(self, rhs: Self) -> (Self, bool)
pub const fn wrapping_sub(self, rhs: Self) -> Self
pub fn absdiff(self, rhs: Self) -> Self
Source§impl ClockTime
impl ClockTime
pub const fn checked_div(self, rhs: u64) -> Option<Self>
pub const fn saturating_div(self, rhs: u64) -> Self
pub const fn checked_mul(self, rhs: u64) -> Option<Self>
pub const fn saturating_mul(self, rhs: u64) -> Self
pub fn overflowing_mul(self, rhs: u64) -> (Self, bool)
pub fn wrapping_mul(self, rhs: u64) -> Self
pub const fn checked_rem(self, rhs: u64) -> Option<Self>
Trait Implementations
Source§impl AddAssign for ClockTime
impl AddAssign for ClockTime
Source§fn add_assign(&mut self, rhs: ClockTime)
fn add_assign(&mut self, rhs: ClockTime)
+=
operation. Read moreSource§impl Displayable for ClockTime
impl Displayable for ClockTime
Source§impl DivAssign<u64> for ClockTime
impl DivAssign<u64> for ClockTime
Source§fn div_assign(&mut self, rhs: u64)
fn div_assign(&mut self, rhs: u64)
/=
operation. Read moreSource§impl FormattedValue for ClockTime
impl FormattedValue for ClockTime
Source§impl FromValue<'_> for ClockTime
impl FromValue<'_> for ClockTime
Source§type Checker = ClockTimeValueTypeOrNoneChecker
type Checker = ClockTimeValueTypeOrNoneChecker
Source§impl HasParamSpec for ClockTime
impl HasParamSpec for ClockTime
Source§impl MulAssign<u64> for ClockTime
impl MulAssign<u64> for ClockTime
Source§fn mul_assign(&mut self, rhs: u64)
fn mul_assign(&mut self, rhs: u64)
*=
operation. Read moreSource§impl MulDiv<u64> for ClockTime
impl MulDiv<u64> for ClockTime
Source§fn mul_div_floor(self, num: u64, denom: u64) -> Option<Self>
fn mul_div_floor(self, num: u64, denom: u64) -> Option<Self>
floor(val * num / denom)
, i.e. the largest integer less than or equal to the
result of the division. Read moreSource§fn mul_div_round(self, num: u64, denom: u64) -> Option<Self>
fn mul_div_round(self, num: u64, denom: u64) -> Option<Self>
round(val * num / denom)
, i.e. the closest integer to the result of the
division. If both surrounding integers are the same distance (x.5
), the one with the bigger
absolute value is returned (round away from 0.0). Read moreSource§impl OptionCheckedAdd for ClockTime
impl OptionCheckedAdd for ClockTime
Source§impl OptionCheckedDiv<u64> for ClockTime
impl OptionCheckedDiv<u64> for ClockTime
Source§impl OptionCheckedDiv for ClockTime
impl OptionCheckedDiv for ClockTime
Source§impl OptionCheckedMul<u64> for ClockTime
impl OptionCheckedMul<u64> for ClockTime
Source§impl OptionCheckedRem<u64> for ClockTime
impl OptionCheckedRem<u64> for ClockTime
Source§impl OptionCheckedRem for ClockTime
impl OptionCheckedRem for ClockTime
Source§impl OptionCheckedSub for ClockTime
impl OptionCheckedSub for ClockTime
Source§impl OptionOverflowingAdd for ClockTime
impl OptionOverflowingAdd for ClockTime
Source§impl OptionOverflowingMul<u64> for ClockTime
impl OptionOverflowingMul<u64> for ClockTime
Source§impl OptionOverflowingSub for ClockTime
impl OptionOverflowingSub for ClockTime
Source§impl OptionSaturatingAdd for ClockTime
impl OptionSaturatingAdd for ClockTime
Source§impl OptionSaturatingMul<u64> for ClockTime
impl OptionSaturatingMul<u64> for ClockTime
Source§impl OptionSaturatingSub for ClockTime
impl OptionSaturatingSub for ClockTime
Source§impl OptionWrappingAdd for ClockTime
impl OptionWrappingAdd for ClockTime
Source§impl OptionWrappingMul<u64> for ClockTime
impl OptionWrappingMul<u64> for ClockTime
Source§impl OptionWrappingSub for ClockTime
impl OptionWrappingSub for ClockTime
Source§impl Ord for ClockTime
impl Ord for ClockTime
Source§impl PartialOrd<Signed<ClockTime>> for ClockTime
impl PartialOrd<Signed<ClockTime>> for ClockTime
Source§impl PartialOrd for ClockTime
impl PartialOrd for ClockTime
Source§impl RemAssign<u64> for ClockTime
impl RemAssign<u64> for ClockTime
Source§fn rem_assign(&mut self, rhs: u64)
fn rem_assign(&mut self, rhs: u64)
%=
operation. Read moreSource§impl SubAssign for ClockTime
impl SubAssign for ClockTime
Source§fn sub_assign(&mut self, rhs: ClockTime)
fn sub_assign(&mut self, rhs: ClockTime)
-=
operation. Read moreSource§impl ToValueOptional for ClockTime
impl ToValueOptional for ClockTime
Source§fn to_value_optional(opt: Option<&Self>) -> Value
fn to_value_optional(opt: Option<&Self>) -> Value
Option
to a Value
.Source§impl TryFrom<u64> for ClockTime
impl TryFrom<u64> for ClockTime
Source§type Error = GlibNoneError
type Error = GlibNoneError
Source§impl TryFromGlib<i64> for ClockTime
impl TryFromGlib<i64> for ClockTime
type Error = GlibNoneError
unsafe fn try_from_glib(val: i64) -> Result<Self, GlibNoneError>
Source§impl UnsignedIntoSigned for ClockTime
impl UnsignedIntoSigned for ClockTime
type Signed = Signed<ClockTime>
Source§fn into_positive(self) -> Self::Signed
fn into_positive(self) -> Self::Signed
self
into a Signed::Positive
.Source§fn into_negative(self) -> Self::Signed
fn into_negative(self) -> Self::Signed
self
into a Signed::Negative
.Source§fn into_signed(self, sign: i32) -> Self::Signed
fn into_signed(self, sign: i32) -> Self::Signed
self
into a Signed
matching the given sign
.