pub struct SimpleDateTime { /* private fields */ }Expand description
Simple datetime structure for RFC 2822 date handling without chrono dependency. Stores timestamp as seconds since Unix epoch for simplicity.
Implementations§
Source§impl SimpleDateTime
impl SimpleDateTime
Sourcepub fn from_timestamp(ts: i64) -> Self
pub fn from_timestamp(ts: i64) -> Self
Create from Unix timestamp
Sourcepub fn format_imf_fixdate(&self) -> String
pub fn format_imf_fixdate(&self) -> String
Format date according to RFC 7231 (IMF-fixdate format). Example: “Sun, 06 Nov 1994 08:49:37 GMT”
Sourcepub fn parse_rfc2822(date_str: &str) -> Option<Self>
pub fn parse_rfc2822(date_str: &str) -> Option<Self>
Try to parse an RFC 2822 formatted date string. Returns None if parsing fails.
Trait Implementations§
Source§impl Clone for SimpleDateTime
impl Clone for SimpleDateTime
Source§fn clone(&self) -> SimpleDateTime
fn clone(&self) -> SimpleDateTime
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for SimpleDateTime
Auto Trait Implementations§
impl Freeze for SimpleDateTime
impl RefUnwindSafe for SimpleDateTime
impl Send for SimpleDateTime
impl Sync for SimpleDateTime
impl Unpin for SimpleDateTime
impl UnsafeUnpin for SimpleDateTime
impl UnwindSafe for SimpleDateTime
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