Struct temporal_rs::components::ZonedDateTime
source · #[non_exhaustive]pub struct ZonedDateTime<C: CalendarProtocol, Z: TzProtocol> { /* private fields */ }
Expand description
The native Rust implementation of Temporal.ZonedDateTime
.
Implementations§
source§impl<C: CalendarProtocol, Z: TzProtocol> ZonedDateTime<C, Z>
impl<C: CalendarProtocol, Z: TzProtocol> ZonedDateTime<C, Z>
sourcepub fn new(
nanos: BigInt,
calendar: CalendarSlot<C>,
tz: TimeZoneSlot<Z>
) -> TemporalResult<Self>
pub fn new( nanos: BigInt, calendar: CalendarSlot<C>, tz: TimeZoneSlot<Z> ) -> TemporalResult<Self>
Creates a new valid ZonedDateTime
.
sourcepub fn calendar(&self) -> &CalendarSlot<C>
pub fn calendar(&self) -> &CalendarSlot<C>
Returns ZonedDateTime
’s Calendar.
sourcepub fn tz(&self) -> &TimeZoneSlot<Z>
pub fn tz(&self) -> &TimeZoneSlot<Z>
Returns ZonedDateTime
’s TimeZone
slot.
sourcepub fn epoch_seconds(&self) -> f64
pub fn epoch_seconds(&self) -> f64
Returns the epochSeconds
value of this ZonedDateTime
.
sourcepub fn epoch_milliseconds(&self) -> f64
pub fn epoch_milliseconds(&self) -> f64
Returns the epochMilliseconds
value of this ZonedDateTime
.
sourcepub fn epoch_microseconds(&self) -> f64
pub fn epoch_microseconds(&self) -> f64
Returns the epochMicroseconds
value of this ZonedDateTime
.
sourcepub fn epoch_nanoseconds(&self) -> f64
pub fn epoch_nanoseconds(&self) -> f64
Returns the epochNanoseconds
value of this ZonedDateTime
.
source§impl<C, Z: TzProtocol> ZonedDateTime<C, Z>where
C: CalendarProtocol<Context = Z::Context>,
impl<C, Z: TzProtocol> ZonedDateTime<C, Z>where
C: CalendarProtocol<Context = Z::Context>,
sourcepub fn contextual_year(&self, context: &mut C::Context) -> TemporalResult<i32>
pub fn contextual_year(&self, context: &mut C::Context) -> TemporalResult<i32>
Returns the year
value for this ZonedDateTime
.
sourcepub fn contextual_month(&self, context: &mut C::Context) -> TemporalResult<u8>
pub fn contextual_month(&self, context: &mut C::Context) -> TemporalResult<u8>
Returns the month
value for this ZonedDateTime
.
sourcepub fn contextual_month_code(
&self,
context: &mut C::Context
) -> TemporalResult<TinyStr4>
pub fn contextual_month_code( &self, context: &mut C::Context ) -> TemporalResult<TinyStr4>
Returns the monthCode
value for this ZonedDateTime
.
sourcepub fn contextual_day(&self, context: &mut C::Context) -> TemporalResult<u8>
pub fn contextual_day(&self, context: &mut C::Context) -> TemporalResult<u8>
Returns the day
value for this ZonedDateTime
.
sourcepub fn contextual_hour(&self, context: &mut C::Context) -> TemporalResult<u8>
pub fn contextual_hour(&self, context: &mut C::Context) -> TemporalResult<u8>
Returns the hour
value for this ZonedDateTime
.
sourcepub fn contextual_minute(&self, context: &mut C::Context) -> TemporalResult<u8>
pub fn contextual_minute(&self, context: &mut C::Context) -> TemporalResult<u8>
Returns the minute
value for this ZonedDateTime
.
sourcepub fn contextual_second(&self, context: &mut C::Context) -> TemporalResult<u8>
pub fn contextual_second(&self, context: &mut C::Context) -> TemporalResult<u8>
Returns the second
value for this ZonedDateTime
.
sourcepub fn contextual_millisecond(
&self,
context: &mut C::Context
) -> TemporalResult<u16>
pub fn contextual_millisecond( &self, context: &mut C::Context ) -> TemporalResult<u16>
Returns the millisecond
value for this ZonedDateTime
.
sourcepub fn contextual_microsecond(
&self,
context: &mut C::Context
) -> TemporalResult<u16>
pub fn contextual_microsecond( &self, context: &mut C::Context ) -> TemporalResult<u16>
Returns the microsecond
value for this ZonedDateTime
.
sourcepub fn contextual_nanosecond(
&self,
context: &mut C::Context
) -> TemporalResult<u16>
pub fn contextual_nanosecond( &self, context: &mut C::Context ) -> TemporalResult<u16>
Returns the nanosecond
value for this ZonedDateTime
.
Trait Implementations§
source§impl<C: Clone + CalendarProtocol, Z: Clone + TzProtocol> Clone for ZonedDateTime<C, Z>
impl<C: Clone + CalendarProtocol, Z: Clone + TzProtocol> Clone for ZonedDateTime<C, Z>
source§fn clone(&self) -> ZonedDateTime<C, Z>
fn clone(&self) -> ZonedDateTime<C, Z>
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more