pub trait AsNanoseconds { // Required method fn as_nanos(&self) -> u64; }
Used to do a nanosecond conversion.
This trait allows us to interchangably accept raw integer time values, ones already in nanoseconds, as well as the more conventional Duration which is a result of getting the difference between two Instants.
Duration
Instant
Performs the conversion.