pub struct SamplingInterval { /* private fields */ }
Expand description
The sampling interval used during profile recording.
This doesn’t have to match the actual delta between sample timestamps. It just describes the intended interval.
For profiles without sampling data, this can be set to a meaningless dummy value.
Implementations§
source§impl SamplingInterval
impl SamplingInterval
sourcepub fn from_hz(samples_per_second: f32) -> Self
pub fn from_hz(samples_per_second: f32) -> Self
Create a sampling interval from a sampling frequency in Hz.
Panics on zero or negative values.
sourcepub fn from_millis(millis: u64) -> Self
pub fn from_millis(millis: u64) -> Self
Create a sampling interval from a value in milliseconds.
sourcepub fn from_nanos(nanos: u64) -> Self
pub fn from_nanos(nanos: u64) -> Self
Create a sampling interval from a value in nanoseconds
sourcepub fn as_secs_f64(&self) -> f64
pub fn as_secs_f64(&self) -> f64
Convert the interval to float seconds.
Trait Implementations§
source§impl Clone for SamplingInterval
impl Clone for SamplingInterval
source§fn clone(&self) -> SamplingInterval
fn clone(&self) -> SamplingInterval
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 SamplingInterval
impl Debug for SamplingInterval
source§impl From<Duration> for SamplingInterval
impl From<Duration> for SamplingInterval
source§impl Hash for SamplingInterval
impl Hash for SamplingInterval
source§impl Ord for SamplingInterval
impl Ord for SamplingInterval
source§fn cmp(&self, other: &SamplingInterval) -> Ordering
fn cmp(&self, other: &SamplingInterval) -> Ordering
1.21.0 · 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
source§impl PartialEq for SamplingInterval
impl PartialEq for SamplingInterval
source§fn eq(&self, other: &SamplingInterval) -> bool
fn eq(&self, other: &SamplingInterval) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl PartialOrd for SamplingInterval
impl PartialOrd for SamplingInterval
source§fn partial_cmp(&self, other: &SamplingInterval) -> Option<Ordering>
fn partial_cmp(&self, other: &SamplingInterval) -> Option<Ordering>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moreimpl Copy for SamplingInterval
impl Eq for SamplingInterval
impl StructuralPartialEq for SamplingInterval
Auto Trait Implementations§
impl Freeze for SamplingInterval
impl RefUnwindSafe for SamplingInterval
impl Send for SamplingInterval
impl Sync for SamplingInterval
impl Unpin for SamplingInterval
impl UnwindSafe for SamplingInterval
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