[−][src]Trait spectrusty_core::clock::TimestampOps
A trait providing calculation methods for timestamps.
Allows BusDevice implementations to depend on a generic timestamp type.
Required methods
pub fn from_tstates(ts: FTs) -> Self
[src]
Returns a normalized timestamp from the given number of T-states.
Panics
Panics when the given ts
overflows the capacity of the timestamp.
pub fn into_tstates(self) -> FTs
[src]
pub fn max_value() -> Self
[src]
Returns the largest value that can be represented by a normalized timestamp.
pub fn min_value() -> Self
[src]
Returns the smallest value that can be represented by a normalized timestamp.
pub fn diff_from(self, ts_from: Self) -> FTs
[src]
Returns the difference between ts_from
and self
in the number of T-states.
Panics
May panic if the result would exceed the capacity of the result type.
pub fn saturating_add(self, other: Self) -> Self
[src]
Returns a normalized timestamp after adding other
to it.
Saturates at TimestampOps::min_value or TimestampOps::max_value.
pub fn saturating_sub(self, other: Self) -> Self
[src]
Returns a normalized timestamp after subtracting other
from it.
Saturates at TimestampOps::min_value or TimestampOps::max_value.
Implementors
impl TimestampOps for FTs
[src]
pub fn from_tstates(ts: FTs) -> Self
[src]
pub fn into_tstates(self) -> FTs
[src]
pub fn max_value() -> Self
[src]
pub fn min_value() -> Self
[src]
pub fn diff_from(self, ts_from: Self) -> FTs
[src]
pub fn saturating_add(self, other: Self) -> Self
[src]
pub fn saturating_sub(self, other: Self) -> Self
[src]
impl<V: VideoFrame> TimestampOps for VFrameTs<V>
[src]
pub fn from_tstates(ts: FTs) -> Self
[src]
pub fn into_tstates(self) -> FTs
[src]
pub fn max_value() -> Self
[src]
pub fn min_value() -> Self
[src]
pub fn diff_from(self, vts_from: Self) -> FTs
[src]
pub fn saturating_add(self, other: Self) -> Self
[src]
Panics
May panic if self
or other
hasn't been normalized.
pub fn saturating_sub(self, other: Self) -> Self
[src]
Panics
May panic if self
or other
hasn't been normalized.