pub enum ExifDateTime {
Aware(DateTime<FixedOffset>),
Naive(NaiveDateTime),
}Expand description
EXIF datetime value with timezone awareness preserved.
Variants§
Aware(DateTime<FixedOffset>)
Original value carried a timezone (e.g. assembled with OffsetTimeOriginal).
Naive(NaiveDateTime)
Original value had no timezone (raw DateTime tag).
Implementations§
Source§impl ExifDateTime
impl ExifDateTime
Sourcepub fn aware(&self) -> Option<DateTime<FixedOffset>>
pub fn aware(&self) -> Option<DateTime<FixedOffset>>
Returns the timezone-aware form only when the original value carried one.
Sourcepub fn into_naive(self) -> NaiveDateTime
pub fn into_naive(self) -> NaiveDateTime
Always returns a NaiveDateTime — strips the timezone if present.
Sourcepub fn or_offset(self, fallback: FixedOffset) -> DateTime<FixedOffset>
pub fn or_offset(self, fallback: FixedOffset) -> DateTime<FixedOffset>
If naive, attaches fallback; if already aware, returns the original offset.
Trait Implementations§
Source§impl Clone for ExifDateTime
impl Clone for ExifDateTime
Source§fn clone(&self) -> ExifDateTime
fn clone(&self) -> ExifDateTime
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 moreSource§impl Debug for ExifDateTime
impl Debug for ExifDateTime
Source§impl PartialEq for ExifDateTime
impl PartialEq for ExifDateTime
Source§fn eq(&self, other: &ExifDateTime) -> bool
fn eq(&self, other: &ExifDateTime) -> bool
Tests for
self and other values to be equal, and is used by ==.impl Copy for ExifDateTime
impl Eq for ExifDateTime
impl StructuralPartialEq for ExifDateTime
Auto Trait Implementations§
impl Freeze for ExifDateTime
impl RefUnwindSafe for ExifDateTime
impl Send for ExifDateTime
impl Sync for ExifDateTime
impl Unpin for ExifDateTime
impl UnsafeUnpin for ExifDateTime
impl UnwindSafe for ExifDateTime
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