pub struct WindowTimeDelta(/* private fields */);Expand description
Window time delta structure.
Provides accessor methods that help handle the different possible formats this field can have.
Implementations§
Source§impl WindowTimeDelta
impl WindowTimeDelta
Sourcepub fn from_time_ns(time_ns: u32) -> WindowTimeDelta
pub fn from_time_ns(time_ns: u32) -> WindowTimeDelta
Create a new window time-delta from some timestamp (nanoseconds).
Sourcepub fn from_samples(samples: u32) -> WindowTimeDelta
pub fn from_samples(samples: u32) -> WindowTimeDelta
Create a new window time-delta from some sample counter.
Sourcepub fn from_percent_overlap(percent_overlap: f32) -> WindowTimeDelta
pub fn from_percent_overlap(percent_overlap: f32) -> WindowTimeDelta
Create a new window time-delta from some percent overlap.
Sourcepub fn as_time_ns(&self) -> u32
pub fn as_time_ns(&self) -> u32
Get the window time-delta as nanoseconds (resolved to the nearest whole sample).
Sourcepub fn set_time_ns(&mut self, time_ns: u32)
pub fn set_time_ns(&mut self, time_ns: u32)
Set the window time-delta as nanoseconds (resolved to the nearest whole sample).
Sourcepub fn as_samples(&self) -> u32
pub fn as_samples(&self) -> u32
Get the window time-delta as raw samples.
Sourcepub fn set_samples(&mut self, samples: u32)
pub fn set_samples(&mut self, samples: u32)
Get the window time-delta as raw samples.
Sourcepub fn as_percent_overlap(&self) -> f32
pub fn as_percent_overlap(&self) -> f32
Get the window time-delta as percent overlap (resolved to the nearest whole sample).
Sourcepub fn set_percent_overlap(&mut self, percent_overlap: f32)
pub fn set_percent_overlap(&mut self, percent_overlap: f32)
Set the window time-delta as percent overlap (resolved to the nearest whole sample).
Trait Implementations§
Source§impl Clone for WindowTimeDelta
impl Clone for WindowTimeDelta
Source§fn clone(&self) -> WindowTimeDelta
fn clone(&self) -> WindowTimeDelta
Returns a duplicate 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 WindowTimeDelta
impl Debug for WindowTimeDelta
Source§impl Default for WindowTimeDelta
impl Default for WindowTimeDelta
Source§fn default() -> WindowTimeDelta
fn default() -> WindowTimeDelta
Returns the “default value” for a type. Read more
Source§impl DekuReader<'_, Endian> for WindowTimeDelta
impl DekuReader<'_, Endian> for WindowTimeDelta
Source§impl DekuUpdate for WindowTimeDelta
impl DekuUpdate for WindowTimeDelta
Source§impl DekuWriter<Endian> for WindowTimeDelta
impl DekuWriter<Endian> for WindowTimeDelta
Source§impl<'de> Deserialize<'de> for WindowTimeDelta
impl<'de> Deserialize<'de> for WindowTimeDelta
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Hash for WindowTimeDelta
impl Hash for WindowTimeDelta
Source§impl Ord for WindowTimeDelta
impl Ord for WindowTimeDelta
Source§fn cmp(&self, other: &WindowTimeDelta) -> Ordering
fn cmp(&self, other: &WindowTimeDelta) -> 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 WindowTimeDelta
impl PartialEq for WindowTimeDelta
Source§impl PartialOrd for WindowTimeDelta
impl PartialOrd for WindowTimeDelta
Source§impl Serialize for WindowTimeDelta
impl Serialize for WindowTimeDelta
impl Copy for WindowTimeDelta
impl Eq for WindowTimeDelta
impl StructuralPartialEq for WindowTimeDelta
Auto Trait Implementations§
impl Freeze for WindowTimeDelta
impl RefUnwindSafe for WindowTimeDelta
impl Send for WindowTimeDelta
impl Sync for WindowTimeDelta
impl Unpin for WindowTimeDelta
impl UnwindSafe for WindowTimeDelta
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
Source§impl<T> CheckedAs for T
impl<T> CheckedAs for T
Source§fn checked_as<Dst>(self) -> Option<Dst>where
T: CheckedCast<Dst>,
fn checked_as<Dst>(self) -> Option<Dst>where
T: CheckedCast<Dst>,
Casts the value.
Source§impl<Src, Dst> CheckedCastFrom<Src> for Dstwhere
Src: CheckedCast<Dst>,
impl<Src, Dst> CheckedCastFrom<Src> for Dstwhere
Src: CheckedCast<Dst>,
Source§fn checked_cast_from(src: Src) -> Option<Dst>
fn checked_cast_from(src: Src) -> Option<Dst>
Casts the value.
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Src, Dst> LosslessTryInto<Dst> for Srcwhere
Dst: LosslessTryFrom<Src>,
impl<Src, Dst> LosslessTryInto<Dst> for Srcwhere
Dst: LosslessTryFrom<Src>,
Source§fn lossless_try_into(self) -> Option<Dst>
fn lossless_try_into(self) -> Option<Dst>
Performs the conversion.
Source§impl<Src, Dst> LossyInto<Dst> for Srcwhere
Dst: LossyFrom<Src>,
impl<Src, Dst> LossyInto<Dst> for Srcwhere
Dst: LossyFrom<Src>,
Source§fn lossy_into(self) -> Dst
fn lossy_into(self) -> Dst
Performs the conversion.
Source§impl<T> OverflowingAs for T
impl<T> OverflowingAs for T
Source§fn overflowing_as<Dst>(self) -> (Dst, bool)where
T: OverflowingCast<Dst>,
fn overflowing_as<Dst>(self) -> (Dst, bool)where
T: OverflowingCast<Dst>,
Casts the value.
Source§impl<Src, Dst> OverflowingCastFrom<Src> for Dstwhere
Src: OverflowingCast<Dst>,
impl<Src, Dst> OverflowingCastFrom<Src> for Dstwhere
Src: OverflowingCast<Dst>,
Source§fn overflowing_cast_from(src: Src) -> (Dst, bool)
fn overflowing_cast_from(src: Src) -> (Dst, bool)
Casts the value.
Source§impl<T> SaturatingAs for T
impl<T> SaturatingAs for T
Source§fn saturating_as<Dst>(self) -> Dstwhere
T: SaturatingCast<Dst>,
fn saturating_as<Dst>(self) -> Dstwhere
T: SaturatingCast<Dst>,
Casts the value.
Source§impl<Src, Dst> SaturatingCastFrom<Src> for Dstwhere
Src: SaturatingCast<Dst>,
impl<Src, Dst> SaturatingCastFrom<Src> for Dstwhere
Src: SaturatingCast<Dst>,
Source§fn saturating_cast_from(src: Src) -> Dst
fn saturating_cast_from(src: Src) -> Dst
Casts the value.
Source§impl<T> UnwrappedAs for T
impl<T> UnwrappedAs for T
Source§fn unwrapped_as<Dst>(self) -> Dstwhere
T: UnwrappedCast<Dst>,
fn unwrapped_as<Dst>(self) -> Dstwhere
T: UnwrappedCast<Dst>,
Casts the value.
Source§impl<Src, Dst> UnwrappedCastFrom<Src> for Dstwhere
Src: UnwrappedCast<Dst>,
impl<Src, Dst> UnwrappedCastFrom<Src> for Dstwhere
Src: UnwrappedCast<Dst>,
Source§fn unwrapped_cast_from(src: Src) -> Dst
fn unwrapped_cast_from(src: Src) -> Dst
Casts the value.
Source§impl<T> WrappingAs for T
impl<T> WrappingAs for T
Source§fn wrapping_as<Dst>(self) -> Dstwhere
T: WrappingCast<Dst>,
fn wrapping_as<Dst>(self) -> Dstwhere
T: WrappingCast<Dst>,
Casts the value.
Source§impl<Src, Dst> WrappingCastFrom<Src> for Dstwhere
Src: WrappingCast<Dst>,
impl<Src, Dst> WrappingCastFrom<Src> for Dstwhere
Src: WrappingCast<Dst>,
Source§fn wrapping_cast_from(src: Src) -> Dst
fn wrapping_cast_from(src: Src) -> Dst
Casts the value.