#[repr(C)]pub struct LinuxTimespec {
pub tv_sec: isize,
pub tv_nsec: isize,
}Available on crate feature
linux only.Expand description
Represents the timespec structure from libc.
Time in seconds and nanoseconds.
Fields§
§tv_sec: isizeNumber of whole seconds.
tv_nsec: isizeNumber of nanoseconds.
Implementations§
source§impl LinuxTimespec
impl LinuxTimespec
sourcepub const fn new(seconds: isize, nanoseconds: isize) -> Self
pub const fn new(seconds: isize, nanoseconds: isize) -> Self
Returns a new LinuxTimespec with the given seconds and nanoseconds.
sourcepub const fn with(duration: Duration) -> Self
pub const fn with(duration: Duration) -> Self
Returns a new LinuxTimespec with the given duration.
sourcepub const fn as_ptr(&self) -> *const Self
pub const fn as_ptr(&self) -> *const Self
Returns a raw pointer to self.
sourcepub fn as_mut_ptr(&mut self) -> *mut Self
pub fn as_mut_ptr(&mut self) -> *mut Self
Returns a raw mutable pointer to self.
Trait Implementations§
source§impl Clone for LinuxTimespec
impl Clone for LinuxTimespec
source§fn clone(&self) -> LinuxTimespec
fn clone(&self) -> LinuxTimespec
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moresource§impl Debug for LinuxTimespec
impl Debug for LinuxTimespec
source§impl Default for LinuxTimespec
impl Default for LinuxTimespec
source§fn default() -> LinuxTimespec
fn default() -> LinuxTimespec
Returns the “default value” for a type. Read more
source§impl From<Duration> for LinuxTimespec
impl From<Duration> for LinuxTimespec
source§impl PartialEq for LinuxTimespec
impl PartialEq for LinuxTimespec
source§fn eq(&self, other: &LinuxTimespec) -> bool
fn eq(&self, other: &LinuxTimespec) -> bool
This method tests for
self and other values to be equal, and is used
by ==.impl Copy for LinuxTimespec
impl StructuralPartialEq for LinuxTimespec
Auto Trait Implementations§
impl RefUnwindSafe for LinuxTimespec
impl Send for LinuxTimespec
impl Sync for LinuxTimespec
impl Unpin for LinuxTimespec
impl UnwindSafe for LinuxTimespec
Blanket Implementations§
source§impl<T> Also for T
impl<T> Also for T
source§impl<T> AnyExt for Twhere
T: Any,
impl<T> AnyExt for Twhere
T: Any,
source§fn type_name(&self) -> &'static str
fn type_name(&self) -> &'static str
Available on crate feature
any only.Returns the type name of
self. Read moresource§fn as_any_ref(&self) -> &dyn Anywhere
Self: Sized,
fn as_any_ref(&self) -> &dyn Anywhere
Self: Sized,
Available on crate feature
any only.source§fn as_any_mut(&mut self) -> &mut dyn Anywhere
Self: Sized,
fn as_any_mut(&mut self) -> &mut dyn Anywhere
Self: Sized,
Available on crate feature
any only.source§impl<T, Res> Apply<Res> for Twhere
T: ?Sized,
impl<T, Res> Apply<Res> for Twhere
T: ?Sized,
source§fn apply<F: FnOnce(Self) -> Res>(self, f: F) -> Reswhere
Self: Sized,
fn apply<F: FnOnce(Self) -> Res>(self, f: F) -> Reswhere
Self: Sized,
Available on crate feature
result only.Apply a function which takes the parameter by value.
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
source§impl<T> Mem for Twhere
T: ?Sized,
impl<T> Mem for Twhere
T: ?Sized,
source§const NEEDS_DROP: bool = _
const NEEDS_DROP: bool = _
Available on crate feature
mem only.Whether dropping values of this type matters.
source§fn mem_needs_drop(&self) -> bool
fn mem_needs_drop(&self) -> bool
Available on crate feature
mem only.Returns
true if dropping values of this type matters.source§fn mem_drop(self)where
Self: Sized,
fn mem_drop(self)where
Self: Sized,
Available on crate feature
mem only.Drops
self by running its destructor.source§fn mem_forget(self)where
Self: Sized,
fn mem_forget(self)where
Self: Sized,
Available on crate feature
mem only.Forgets about
self without running its destructor.source§fn mem_replace(&mut self, other: Self) -> Selfwhere
Self: Sized,
fn mem_replace(&mut self, other: Self) -> Selfwhere
Self: Sized,
Available on crate feature
mem only.Replaces
self with other, returning the previous value of self.source§fn mem_take(&mut self) -> Selfwhere
Self: Default,
fn mem_take(&mut self) -> Selfwhere
Self: Default,
Available on crate feature
mem only.Replaces
self with its default value, returning the previous value of self.source§fn mem_swap(&mut self, other: &mut Self)where
Self: Sized,
fn mem_swap(&mut self, other: &mut Self)where
Self: Sized,
Available on crate feature
mem only.Swaps the value of
self and other without deinitializing either one.source§fn mem_as_bytes(&self) -> &[u8] ⓘ
fn mem_as_bytes(&self) -> &[u8] ⓘ
Available on crate features
mem and unsafe_mem only.source§impl<T> Size for T
impl<T> Size for T
source§const BYTE_ALIGN: usize = _
const BYTE_ALIGN: usize = _
Available on crate feature
mem only.The alignment of this type in bytes.
source§const BYTE_SIZE: usize = _
const BYTE_SIZE: usize = _
Available on crate feature
mem only.The size of this type in bytes.
source§const PTR_SIZE: usize = 8usize
const PTR_SIZE: usize = 8usize
Available on crate feature
mem only.The size of a pointer in bytes, for the current platform.
source§fn byte_align(&self) -> usize
fn byte_align(&self) -> usize
Available on crate feature
mem only.Returns the alignment of this type in bytes.