pub struct Runtime(_, _);Expand description
Human readable “audio/video runtime” in H:M:S format.
From input can either be f32, f64, or std::time::Duration.
f32 and f64 input are presumed to be in seconds.
Formatting rules:
secondsalways has leading0.minutesonly has a leading zero ifhoursisn’t0.hoursnever has a leading0.
Exceptions
| Exceptions | String Output |
|---|---|
f64::NAN | NaN |
f64::INFINITY & f64::NEG_INFINITY | ∞ |
To disable checks for these, (you are sure you don’t have NaN’s), enable the ignore_nan_inf feature flag.
Examples
| Input | Output |
|---|---|
1.0 | 0:01 |
61.0 | 1:01 |
11.1111 | 0:11 |
111.111 | 1:51 |
11111.1 | 3:05:11 |
Implementations§
Trait Implementations§
source§impl<'de> Deserialize<'de> for Runtime
impl<'de> Deserialize<'de> for Runtime
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 PartialEq<&str> for Runtime
impl PartialEq<&str> for Runtime
source§impl PartialEq<Runtime> for Runtime
impl PartialEq<Runtime> for Runtime
source§impl PartialEq<Runtime> for f64
impl PartialEq<Runtime> for f64
source§impl PartialEq<Runtime> for str
impl PartialEq<Runtime> for str
source§impl PartialOrd<Runtime> for Runtime
impl PartialOrd<Runtime> for Runtime
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 StructuralPartialEq for Runtime
Auto Trait Implementations§
impl RefUnwindSafe for Runtime
impl Send for Runtime
impl Sync for Runtime
impl Unpin for Runtime
impl UnwindSafe for Runtime
Blanket Implementations§
source§impl<T> ToCompactString for Twhere
T: Display,
impl<T> ToCompactString for Twhere T: Display,
source§fn to_compact_string(&self) -> CompactString
fn to_compact_string(&self) -> CompactString
Converts the given value to a
CompactString. Read more