pub enum RenderZone {
Utc,
Fixed(Offset),
Named(TimeZone),
}Expand description
A target timezone for rendering an instant (PosixNs). Presentation
only — it never changes the underlying instant, just how it is displayed.
The default (RenderZone::Utc) renders with a Z suffix.
Variants§
Utc
UTC, rendered with a Z suffix (the unambiguous default).
Fixed(Offset)
A fixed offset from UTC (e.g. +08:00), rendered with a numeric offset.
Named(TimeZone)
A named IANA zone (e.g. America/New_York), pre-validated at parse time.
The offset is resolved per instant, so the rendering is DST-correct.
Implementations§
Source§impl RenderZone
impl RenderZone
Sourcepub fn parse(spec: &str) -> Result<Self, ChronoError>
pub fn parse(spec: &str) -> Result<Self, ChronoError>
Parse a zone spec: empty / UTC / Z → UTC; a leading +/- → a fixed
offset (+HH, ±HH:MM, ±HHMM); anything else → an IANA zone name,
validated against the tz database. An unrecognised name errors loudly
(ChronoError::UnknownZone) rather than silently falling back to UTC.
Trait Implementations§
Source§impl Clone for RenderZone
impl Clone for RenderZone
Source§fn clone(&self) -> RenderZone
fn clone(&self) -> RenderZone
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 moreAuto Trait Implementations§
impl Freeze for RenderZone
impl RefUnwindSafe for RenderZone
impl Send for RenderZone
impl Sync for RenderZone
impl Unpin for RenderZone
impl UnsafeUnpin for RenderZone
impl UnwindSafe for RenderZone
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