Struct libpulse_binding::time::Timeval
source · #[repr(transparent)]pub struct Timeval(pub timeval);
Expand description
Wrapper for libc::timeval
, attaching various methods and trait implementations.
Tuple Fields§
§0: timeval
Implementations§
source§impl Timeval
impl Timeval
sourcepub const fn new(sec: time_t, usec: suseconds_t) -> Self
pub const fn new(sec: time_t, usec: suseconds_t) -> Self
Creates a new instance, with values provided.
sourcepub fn diff(a: &Self, b: &Self) -> MicroSeconds
pub fn diff(a: &Self, b: &Self) -> MicroSeconds
Calculates the difference between the two specified timeval structs.
sourcepub fn age(&self) -> MicroSeconds
pub fn age(&self) -> MicroSeconds
Gets the time difference between now and self.
sourcepub fn checked_add(self, other: Self) -> Option<Self>
pub fn checked_add(self, other: Self) -> Option<Self>
Checked integer addition. Computes self + rhs
, returning None
if overflow occurred,
using the inner integer’s checked_add()
method.
sourcepub fn checked_add_us(self, rhs: MicroSeconds) -> Option<Self>
pub fn checked_add_us(self, rhs: MicroSeconds) -> Option<Self>
Checked integer addition. Computes self + rhs
, returning None
if overflow occurred,
using the inner integer’s checked_add()
method.
sourcepub fn checked_add_duration(self, rhs: Duration) -> Option<Self>
pub fn checked_add_duration(self, rhs: Duration) -> Option<Self>
Checked integer addition. Computes self + rhs
, returning None
if overflow occurred,
using the inner integer’s checked_add()
method.
sourcepub fn checked_sub(self, other: Self) -> Option<Self>
pub fn checked_sub(self, other: Self) -> Option<Self>
Checked integer subtraction. Computes self - rhs
, returning None
if overflow occurred,
using the inner integer’s checked_sub()
method.
sourcepub fn checked_sub_us(self, rhs: MicroSeconds) -> Option<Self>
pub fn checked_sub_us(self, rhs: MicroSeconds) -> Option<Self>
Checked integer subtraction. Computes self - rhs
, returning None
if overflow occurred,
using the inner integer’s checked_sub()
method.
sourcepub fn checked_sub_duration(self, rhs: Duration) -> Option<Self>
pub fn checked_sub_duration(self, rhs: Duration) -> Option<Self>
Checked integer subtraction. Computes self - rhs
, returning None
if overflow occurred,
using the inner integer’s checked_sub()
method.
sourcepub fn checked_mul(self, rhs: u32) -> Option<Self>
pub fn checked_mul(self, rhs: u32) -> Option<Self>
Checked integer multiplication. Computes self * rhs
, returning None
if overflow
occurred, using the inner integer’s checked_mul()
method.
sourcepub fn checked_div(self, rhs: u32) -> Option<Self>
pub fn checked_div(self, rhs: u32) -> Option<Self>
Checked integer division. Computes self / rhs
, returning None
if rhs == 0
, using the
inner integer’s checked_div()
method.
sourcepub fn checked_rem(self, rhs: u32) -> Option<Self>
pub fn checked_rem(self, rhs: u32) -> Option<Self>
Checked integer remainder. Computes self % rhs
, returning None
if rhs == 0
, using the
inner integer’s checked_rem()
method.
Trait Implementations§
source§impl Add<MicroSeconds> for Timeval
impl Add<MicroSeconds> for Timeval
source§impl AddAssign<Duration> for Timeval
impl AddAssign<Duration> for Timeval
source§fn add_assign(&mut self, rhs: Duration)
fn add_assign(&mut self, rhs: Duration)
+=
operation. Read moresource§impl AddAssign<MicroSeconds> for Timeval
impl AddAssign<MicroSeconds> for Timeval
source§fn add_assign(&mut self, rhs: MicroSeconds)
fn add_assign(&mut self, rhs: MicroSeconds)
+=
operation. Read moresource§impl AddAssign<Timeval> for Timeval
impl AddAssign<Timeval> for Timeval
source§fn add_assign(&mut self, rhs: Self)
fn add_assign(&mut self, rhs: Self)
+=
operation. Read moresource§impl DivAssign<u32> for Timeval
impl DivAssign<u32> for Timeval
source§fn div_assign(&mut self, rhs: u32)
fn div_assign(&mut self, rhs: u32)
/=
operation. Read moresource§impl From<MicroSeconds> for Timeval
impl From<MicroSeconds> for Timeval
source§fn from(t: MicroSeconds) -> Self
fn from(t: MicroSeconds) -> Self
source§impl From<Timeval> for MicroSeconds
impl From<Timeval> for MicroSeconds
source§impl MulAssign<u32> for Timeval
impl MulAssign<u32> for Timeval
source§fn mul_assign(&mut self, rhs: u32)
fn mul_assign(&mut self, rhs: u32)
*=
operation. Read moresource§impl Ord for Timeval
impl Ord for Timeval
source§impl PartialEq<Timeval> for Timeval
impl PartialEq<Timeval> for Timeval
source§impl PartialOrd<Timeval> for Timeval
impl PartialOrd<Timeval> for Timeval
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
self
and other
) and is used by the <=
operator. Read moresource§impl RemAssign<u32> for Timeval
impl RemAssign<u32> for Timeval
source§fn rem_assign(&mut self, rhs: u32)
fn rem_assign(&mut self, rhs: u32)
%=
operation. Read moresource§impl Sub<MicroSeconds> for Timeval
impl Sub<MicroSeconds> for Timeval
source§impl SubAssign<Duration> for Timeval
impl SubAssign<Duration> for Timeval
source§fn sub_assign(&mut self, rhs: Duration)
fn sub_assign(&mut self, rhs: Duration)
-=
operation. Read moresource§impl SubAssign<MicroSeconds> for Timeval
impl SubAssign<MicroSeconds> for Timeval
source§fn sub_assign(&mut self, rhs: MicroSeconds)
fn sub_assign(&mut self, rhs: MicroSeconds)
-=
operation. Read moresource§impl SubAssign<Timeval> for Timeval
impl SubAssign<Timeval> for Timeval
source§fn sub_assign(&mut self, rhs: Self)
fn sub_assign(&mut self, rhs: Self)
-=
operation. Read more