Struct temporal_rs::components::YearMonth
source · #[non_exhaustive]pub struct YearMonth<C: CalendarProtocol> { /* private fields */ }
Expand description
The native Rust implementation of Temporal.YearMonth
.
Implementations§
source§impl<C: CalendarProtocol> YearMonth<C>
impl<C: CalendarProtocol> YearMonth<C>
sourcepub fn new(
year: i32,
month: i32,
reference_day: Option<i32>,
calendar: CalendarSlot<C>,
overflow: ArithmeticOverflow
) -> TemporalResult<Self>
pub fn new( year: i32, month: i32, reference_day: Option<i32>, calendar: CalendarSlot<C>, overflow: ArithmeticOverflow ) -> TemporalResult<Self>
Creates a new valid YearMonth
.
sourcepub fn calendar(&self) -> &CalendarSlot<C>
pub fn calendar(&self) -> &CalendarSlot<C>
Returns the Calendar value.
Trait Implementations§
source§impl<C: CalendarProtocol> FromStr for YearMonth<C>
impl<C: CalendarProtocol> FromStr for YearMonth<C>
source§impl<C: CalendarProtocol> GetCalendarSlot<C> for YearMonth<C>
impl<C: CalendarProtocol> GetCalendarSlot<C> for YearMonth<C>
source§fn get_calendar(&self) -> CalendarSlot<C>
fn get_calendar(&self) -> CalendarSlot<C>
Returns a reference to YearMonth
’s CalendarSlot
source§impl<C: CalendarProtocol> IsoDateSlots for YearMonth<C>
impl<C: CalendarProtocol> IsoDateSlots for YearMonth<C>
Auto Trait Implementations§
impl<C> RefUnwindSafe for YearMonth<C>where
C: RefUnwindSafe,
impl<C> !Send for YearMonth<C>
impl<C> !Sync for YearMonth<C>
impl<C> Unpin for YearMonth<C>where
C: Unpin,
impl<C> UnwindSafe for YearMonth<C>where
C: UnwindSafe,
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