pub struct LocalTimeZone { /* private fields */ }Expand description
An immutable local-time resolver.
Materialized system resolvers own the complete time-zone rule set rather than the offset sampled at “now”: another target date may be on the other side of a daylight-saving transition. The captured rules and their lazily computed provenance are shared by every clone of a resolver.
Wide civil dates remain project-owned. Jiff is used only as the system time-zone rule engine; dates outside Jiff’s civil range are projected onto a Gregorian-equivalent year before rules are queried and are then mapped back without narrowing the represented instant.
Implementations§
Source§impl LocalTimeZone
impl LocalTimeZone
pub fn fixed(offset_minutes: i32) -> Result<Self, RuntimePolicyError>
pub fn utc() -> Self
Sourcepub fn try_system() -> Result<Self, RuntimePolicyError>
pub fn try_system() -> Result<Self, RuntimePolicyError>
Captures the system time-zone rules or reports that the adapter is unavailable.
pub fn provenance(&self) -> &LocalTimeZoneProvenance
pub fn is_system(&self) -> bool
pub fn fixed_offset_minutes(&self) -> Option<i32>
Sourcepub fn resolve_local(&self, local: CivilDateTime) -> Option<OffsetDateTime>
pub fn resolve_local(&self, local: CivilDateTime) -> Option<OffsetDateTime>
Resolves a local civil date-time using this resolver’s compatible DST policy.
Gaps move forward by the gap duration and folds select the earlier instant, matching Mermaid’s JavaScript date behavior and Jiff’s compatible disambiguation.
Sourcepub fn at_instant(&self, unix_millis: i64) -> Option<OffsetDateTime>
pub fn at_instant(&self, unix_millis: i64) -> Option<OffsetDateTime>
Applies this resolver’s offset rules to an absolute millisecond instant.
Trait Implementations§
Source§impl Clone for LocalTimeZone
impl Clone for LocalTimeZone
Source§impl Debug for LocalTimeZone
impl Debug for LocalTimeZone
impl Eq for LocalTimeZone
Auto Trait Implementations§
impl Freeze for LocalTimeZone
impl RefUnwindSafe for LocalTimeZone
impl Send for LocalTimeZone
impl Sync for LocalTimeZone
impl Unpin for LocalTimeZone
impl UnsafeUnpin for LocalTimeZone
impl UnwindSafe for LocalTimeZone
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.