Skip to main content

LocalTimeZone

Struct LocalTimeZone 

Source
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

Source

pub fn fixed(offset_minutes: i32) -> Result<Self, RuntimePolicyError>

Source

pub fn utc() -> Self

Source

pub fn try_system() -> Result<Self, RuntimePolicyError>

Captures the system time-zone rules or reports that the adapter is unavailable.

Source

pub fn provenance(&self) -> &LocalTimeZoneProvenance

Source

pub fn is_system(&self) -> bool

Source

pub fn fixed_offset_minutes(&self) -> Option<i32>

Source

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.

Source

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

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for LocalTimeZone

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Eq for LocalTimeZone

Source§

impl PartialEq for LocalTimeZone

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.