pub trait DateTime {
const DATE_SIZE_HINT: usize = 29usize;
// Required methods
fn with_date<F, O>(&self, f: F) -> O
where F: FnOnce(&[u8]) -> O;
fn now(&self) -> Instant;
}Expand description
Trait for getting current date/time.
This is usually used by a low resolution of timer to reduce frequent syscall to OS.
Provided Associated Constants§
Sourceconst DATE_SIZE_HINT: usize = 29usize
const DATE_SIZE_HINT: usize = 29usize
The size hint of slice by Self::date method.
Required Methods§
Sourcefn with_date<F, O>(&self, f: F) -> O
fn with_date<F, O>(&self, f: F) -> O
closure would receive byte slice representation of HttpDate.
fn now(&self) -> Instant
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.