Skip to main content

TimeZoneRule

Struct TimeZoneRule 

Source
#[non_exhaustive]
pub struct TimeZoneRule { pub at_type: String, pub start: LocalDateTime, pub offset_from: UTCOffset, pub offset_to: UTCOffset, pub recurrence_rules: Option<Vec<RecurrenceRule>>, pub recurrence_overrides: Option<BTreeMap<LocalDateTime, PatchObject>>, pub names: Option<BTreeMap<String, bool>>, pub comments: Option<Vec<String>>, pub extra: Map<String, Value>, }
Expand description

A STANDARD or DAYLIGHT sub-component of a TimeZone (RFC 8984 §4.7.2).

Maps to a VTIMEZONE STANDARD or DAYLIGHT sub-component from iCalendar. At most one recurrence rule is allowed per rule.

Fields (Non-exhaustive)§

This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.
§at_type: String

Object type discriminator; always "TimeZoneRule" on the wire.

Deserialize is liberal: if @type is absent (spec-violating vendor input), this field defaults to "TimeZoneRule" rather than failing the whole parent object’s deserialize. Serialize always emits the field. See bd:JMAP-ky8g.10.

§start: LocalDateTime

DTSTART from iCalendar — the local date-time the rule first applies.

§offset_from: UTCOffset

TZOFFSETFROM from iCalendar — the UTC offset in effect before the transition (format ±HHMM or ±HHMMSS). Typed as UTCOffset for consistency with the other temporal newtypes; the inner string is opaque to this crate (validation deferred to the backend per PLAN.md).

§offset_to: UTCOffset

TZOFFSETTO from iCalendar — the UTC offset in effect after the transition (format ±HHMM or ±HHMMSS). Typed as UTCOffset for consistency with the other temporal newtypes.

§recurrence_rules: Option<Vec<RecurrenceRule>>

RRULE from iCalendar — recurrence rules for the transition. Per RFC 8984 §4.7.2 the until value MUST be interpreted as a local time in the UTC time zone during evaluation.

§recurrence_overrides: Option<BTreeMap<LocalDateTime, PatchObject>>

RDATE properties from iCalendar — additional explicit transition dates. Keys are LocalDateTime strings; the PatchObject value MUST be the empty JSON object ({}) per RFC 8984 §4.7.2.

The type permits non-empty PatchObject values that the wire spec forbids — this is deliberate for round-trip preservation of in-flight data. Consumers check that every value is the empty patch themselves (bd:JMAP-ops7.38).

§names: Option<BTreeMap<String, bool>>

TZNAME properties from iCalendar — set of human-readable names for this rule. The map value MUST be true for each key.

§comments: Option<Vec<String>>

COMMENT properties from iCalendar — order MUST be preserved.

§extra: Map<String, Value>

Catch-all for vendor / site / private extension fields not covered by the typed fields above. Preserves unknown fields across deserialize/serialize round-trip per workspace extras-preservation policy (see workspace AGENTS.md).

Trait Implementations§

Source§

impl Clone for TimeZoneRule

Source§

fn clone(&self) -> TimeZoneRule

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 TimeZoneRule

Source§

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

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

impl<'de> Deserialize<'de> for TimeZoneRule

Source§

fn deserialize<__D>( __deserializer: __D, ) -> Result<TimeZoneRule, <__D as Deserializer<'de>>::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Eq for TimeZoneRule

Source§

impl PartialEq for TimeZoneRule

Source§

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

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

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

Inequality operator !=. Read more
Source§

impl Serialize for TimeZoneRule

Source§

fn serialize<__S>( &self, __serializer: __S, ) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for TimeZoneRule

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<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

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.