ruma_common::serde::duration::opt_ms

Function serialize

Source
pub fn serialize<S>(
    opt_duration: &Option<Duration>,
    serializer: S,
) -> Result<S::Ok, S::Error>
where S: Serializer,
Expand description

Serialize an Option<Duration>.

Will fail if integer is greater than the maximum integer that can be unambiguously represented by an f64.