Trait ToU64

Source
pub trait ToU64 {
    // Required method
    fn to_u64(self) -> Result<u64>;
}
Expand description

Trait for converting numeric-like values into a u64.

This is typically used to normalize custom duration types into milliseconds for compatibility with APIs like std::time::Duration::from_millis, which are commonly required in async sleep contexts such as tokio::time::sleep.

Required Methods§

Source

fn to_u64(self) -> Result<u64>

Implementations on Foreign Types§

Source§

impl ToU64 for u8

Source§

impl ToU64 for u16

Source§

impl ToU64 for u32

Source§

impl ToU64 for u64

Source§

impl ToU64 for u128

Implementors§