pub struct Datetime {
pub date: Date,
pub time: Time,
pub secs: u64,
}Expand description
Stores the date, time and raw seconds since the epoch,
with constructor, core methods for update (now) and
output as a HTTP Date header timestamp (for_header),
utility methods for construction via diff (set) and
current number of seconds since the epoch (raw) and
a Default implementation for the Unix epoch values.
§Example
use httpdt::Datetime;
let dt = Datetime::new()
.unwrap();
let ts_initial = dt
.for_header();
// ...
let ts_updated = dt
.now()
.unwrap()
.for_header();Fields§
§date: Date§time: Time§secs: u64Implementations§
Trait Implementations§
impl StructuralPartialEq for Datetime
Auto Trait Implementations§
impl Freeze for Datetime
impl RefUnwindSafe for Datetime
impl Send for Datetime
impl Sync for Datetime
impl Unpin for Datetime
impl UnwindSafe for Datetime
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more