pub struct PlainYearMonth { /* private fields */ }Expand description
A Temporal.PlainYearMonth represents a particular month on the calendar. For example,
it could be used to represent a particular instance of a monthly recurring event, like
“the June 2019 meeting”.
Implementations§
Source§impl PlainYearMonth
impl PlainYearMonth
Sourcepub fn new(iso_year: i32, iso_month: u32) -> Result<PlainYearMonth, RangeError>
pub fn new(iso_year: i32, iso_month: u32) -> Result<PlainYearMonth, RangeError>
The Temporal.PlainYearMonth() constructor creates Temporal.PlainYearMonth objects.
calendar defaults to ISO 8601; reference_iso_day selects the ISO day
used to represent the month in non-ISO calendars.
§Errors
Throws a RangeError if any field is out of range or calendar is not a
supported calendar identifier.
Source§impl PlainYearMonth
impl PlainYearMonth
Sourcepub fn new_with_calendar(
iso_year: i32,
iso_month: u32,
calendar: &str,
) -> Result<PlainYearMonth, RangeError>
pub fn new_with_calendar( iso_year: i32, iso_month: u32, calendar: &str, ) -> Result<PlainYearMonth, RangeError>
The Temporal.PlainYearMonth() constructor; see PlainYearMonth::new for errors.
Source§impl PlainYearMonth
impl PlainYearMonth
Sourcepub fn new_with_calendar_and_reference_iso_day(
iso_year: i32,
iso_month: u32,
calendar: &str,
reference_iso_day: u32,
) -> Result<PlainYearMonth, RangeError>
pub fn new_with_calendar_and_reference_iso_day( iso_year: i32, iso_month: u32, calendar: &str, reference_iso_day: u32, ) -> Result<PlainYearMonth, RangeError>
The Temporal.PlainYearMonth() constructor; see PlainYearMonth::new for errors.
Source§impl PlainYearMonth
impl PlainYearMonth
Sourcepub fn from_with_str(item: &str) -> Result<PlainYearMonth, RangeError>
pub fn from_with_str(item: &str) -> Result<PlainYearMonth, RangeError>
The Temporal.PlainYearMonth.from() static method creates a new Temporal.PlainYearMonth
object from another value.
§Errors
Throws a RangeError if the string is invalid or values are out of range
(when overflow is 'reject').
Source§impl PlainYearMonth
impl PlainYearMonth
Sourcepub fn from_with_str_and_options(
item: &str,
options: &OverflowOptions,
) -> Result<PlainYearMonth, RangeError>
pub fn from_with_str_and_options( item: &str, options: &OverflowOptions, ) -> Result<PlainYearMonth, RangeError>
The Temporal.PlainYearMonth.from() static method; see PlainYearMonth::from_with_str for errors.
Source§impl PlainYearMonth
impl PlainYearMonth
Sourcepub fn from_with_plain_year_month_like(
item: &PlainYearMonthLike,
) -> Result<PlainYearMonth, Error>
pub fn from_with_plain_year_month_like( item: &PlainYearMonthLike, ) -> Result<PlainYearMonth, Error>
The Temporal.PlainYearMonth.from() static method taking a property bag; throws a TypeError if
required fields are missing. See PlainYearMonth::from_with_str for the remaining errors.
Source§impl PlainYearMonth
impl PlainYearMonth
Sourcepub fn from_with_plain_year_month_like_and_options(
item: &PlainYearMonthLike,
options: &OverflowOptions,
) -> Result<PlainYearMonth, Error>
pub fn from_with_plain_year_month_like_and_options( item: &PlainYearMonthLike, options: &OverflowOptions, ) -> Result<PlainYearMonth, Error>
The Temporal.PlainYearMonth.from() static method taking a property bag; throws a TypeError if
required fields are missing. See PlainYearMonth::from_with_str for the remaining errors.
Source§impl PlainYearMonth
impl PlainYearMonth
Sourcepub fn from_with_plain_year_month(item: &PlainYearMonth) -> PlainYearMonth
pub fn from_with_plain_year_month(item: &PlainYearMonth) -> PlainYearMonth
The Temporal.PlainYearMonth.from() static method.
Source§impl PlainYearMonth
impl PlainYearMonth
Sourcepub fn from_with_plain_year_month_and_options(
item: &PlainYearMonth,
options: &OverflowOptions,
) -> PlainYearMonth
pub fn from_with_plain_year_month_and_options( item: &PlainYearMonth, options: &OverflowOptions, ) -> PlainYearMonth
The Temporal.PlainYearMonth.from() static method.
Source§impl PlainYearMonth
impl PlainYearMonth
Sourcepub fn compare(one: &PlainYearMonth, two: &PlainYearMonth) -> i32
pub fn compare(one: &PlainYearMonth, two: &PlainYearMonth) -> i32
The Temporal.PlainYearMonth.compare() static method returns -1, 0, or 1 depending
on whether one comes before, is equal to, or comes after two.
Source§impl PlainYearMonth
impl PlainYearMonth
Sourcepub fn from_with_plain_date(
item: &PlainDate,
) -> Result<PlainYearMonth, RangeError>
pub fn from_with_plain_date( item: &PlainDate, ) -> Result<PlainYearMonth, RangeError>
The Temporal.PlainYearMonth.from() static method.
§Errors
Throws a RangeError if the first day of the month falls outside the representable range.
Source§impl PlainYearMonth
impl PlainYearMonth
Sourcepub fn from_with_plain_date_and_options(
item: &PlainDate,
options: &OverflowOptions,
) -> Result<PlainYearMonth, RangeError>
pub fn from_with_plain_date_and_options( item: &PlainDate, options: &OverflowOptions, ) -> Result<PlainYearMonth, RangeError>
The Temporal.PlainYearMonth.from() static method; see
PlainYearMonth::from_with_plain_date for errors.
Source§impl PlainYearMonth
impl PlainYearMonth
Sourcepub fn from_with_plain_date_time(
item: &PlainDateTime,
) -> Result<PlainYearMonth, RangeError>
pub fn from_with_plain_date_time( item: &PlainDateTime, ) -> Result<PlainYearMonth, RangeError>
The Temporal.PlainYearMonth.from() static method.
§Errors
Throws a RangeError if the first day of the month falls outside the representable range.
Source§impl PlainYearMonth
impl PlainYearMonth
Sourcepub fn from_with_plain_date_time_and_options(
item: &PlainDateTime,
options: &OverflowOptions,
) -> Result<PlainYearMonth, RangeError>
pub fn from_with_plain_date_time_and_options( item: &PlainDateTime, options: &OverflowOptions, ) -> Result<PlainYearMonth, RangeError>
The Temporal.PlainYearMonth.from() static method; see
PlainYearMonth::from_with_plain_date_time for errors.
Source§impl PlainYearMonth
impl PlainYearMonth
Sourcepub fn from_with_zoned_date_time(
item: &ZonedDateTime,
) -> Result<PlainYearMonth, RangeError>
pub fn from_with_zoned_date_time( item: &ZonedDateTime, ) -> Result<PlainYearMonth, RangeError>
The Temporal.PlainYearMonth.from() static method.
§Errors
Throws a RangeError if the first day of the month falls outside the representable range.
Source§impl PlainYearMonth
impl PlainYearMonth
Sourcepub fn from_with_zoned_date_time_and_options(
item: &ZonedDateTime,
options: &OverflowOptions,
) -> Result<PlainYearMonth, RangeError>
pub fn from_with_zoned_date_time_and_options( item: &ZonedDateTime, options: &OverflowOptions, ) -> Result<PlainYearMonth, RangeError>
The Temporal.PlainYearMonth.from() static method; see
PlainYearMonth::from_with_zoned_date_time for errors.
Source§impl PlainYearMonth
impl PlainYearMonth
Source§impl PlainYearMonth
impl PlainYearMonth
Source§impl PlainYearMonth
impl PlainYearMonth
Source§impl PlainYearMonth
impl PlainYearMonth
Source§impl PlainYearMonth
impl PlainYearMonth
Sourcepub fn month_code(&self) -> JsString
pub fn month_code(&self) -> JsString
The monthCode accessor property returns a calendar-specific string representing
the month of this year-month.
Source§impl PlainYearMonth
impl PlainYearMonth
Sourcepub fn calendar_id(&self) -> JsString
pub fn calendar_id(&self) -> JsString
The calendarId accessor property returns a string representing the calendar
used to interpret the internal ISO 8601 date.
Source§impl PlainYearMonth
impl PlainYearMonth
Sourcepub fn days_in_month(&self) -> u32
pub fn days_in_month(&self) -> u32
The daysInMonth accessor property returns a positive integer representing the
number of days in the month of this year-month.
Source§impl PlainYearMonth
impl PlainYearMonth
Sourcepub fn days_in_year(&self) -> u32
pub fn days_in_year(&self) -> u32
The daysInYear accessor property returns a positive integer representing the
number of days in the year of this year-month.
Source§impl PlainYearMonth
impl PlainYearMonth
Sourcepub fn months_in_year(&self) -> u32
pub fn months_in_year(&self) -> u32
The monthsInYear accessor property returns a positive integer representing the
number of months in the year of this year-month.
Source§impl PlainYearMonth
impl PlainYearMonth
Sourcepub fn in_leap_year(&self) -> bool
pub fn in_leap_year(&self) -> bool
The inLeapYear accessor property returns true if this year-month is in a leap year,
and false otherwise.
Source§impl PlainYearMonth
impl PlainYearMonth
Sourcepub fn equals(&self, other: &PlainYearMonth) -> bool
pub fn equals(&self, other: &PlainYearMonth) -> bool
The equals() method returns true if this year-month is equivalent to other.
Source§impl PlainYearMonth
impl PlainYearMonth
Sourcepub fn with(
&self,
fields: &PlainYearMonthFields,
) -> Result<PlainYearMonth, Error>
pub fn with( &self, fields: &PlainYearMonthFields, ) -> Result<PlainYearMonth, Error>
The with() method returns a new Temporal.PlainYearMonth object with some
fields replaced by new values.
§Errors
Throws a TypeError if no recognised field is set, and a RangeError if values are out
of range or overflow is 'reject' and a field would need constraining.
Source§impl PlainYearMonth
impl PlainYearMonth
Sourcepub fn equals_with_plain_date(
&self,
other: &PlainDate,
) -> Result<bool, RangeError>
pub fn equals_with_plain_date( &self, other: &PlainDate, ) -> Result<bool, RangeError>
The equals() method taking a Temporal.PlainDate; throws a RangeError if the first day
of its month falls outside the representable range.
Source§impl PlainYearMonth
impl PlainYearMonth
Sourcepub fn equals_with_plain_date_time(
&self,
other: &PlainDateTime,
) -> Result<bool, RangeError>
pub fn equals_with_plain_date_time( &self, other: &PlainDateTime, ) -> Result<bool, RangeError>
The equals() method taking a Temporal.PlainDateTime; throws a RangeError if the first day
of its month falls outside the representable range.
Source§impl PlainYearMonth
impl PlainYearMonth
Sourcepub fn equals_with_zoned_date_time(
&self,
other: &ZonedDateTime,
) -> Result<bool, RangeError>
pub fn equals_with_zoned_date_time( &self, other: &ZonedDateTime, ) -> Result<bool, RangeError>
The equals() method taking a Temporal.ZonedDateTime; throws a RangeError if the first day
of its month falls outside the representable range.
Source§impl PlainYearMonth
impl PlainYearMonth
Sourcepub fn equals_with_plain_year_month_like(
&self,
other: &PlainYearMonthLike,
) -> Result<bool, Error>
pub fn equals_with_plain_year_month_like( &self, other: &PlainYearMonthLike, ) -> Result<bool, Error>
The equals() method taking a property bag; throws a TypeError if required fields are missing.
Source§impl PlainYearMonth
impl PlainYearMonth
Sourcepub fn equals_with_str(&self, other: &str) -> Result<bool, RangeError>
pub fn equals_with_str(&self, other: &str) -> Result<bool, RangeError>
The equals() method taking an ISO 8601 string; throws a RangeError if the string is invalid.
Source§impl PlainYearMonth
impl PlainYearMonth
Sourcepub fn with_with_options(
&self,
fields: &PlainYearMonthFields,
options: &OverflowOptions,
) -> Result<PlainYearMonth, Error>
pub fn with_with_options( &self, fields: &PlainYearMonthFields, options: &OverflowOptions, ) -> Result<PlainYearMonth, Error>
The with() method returns a new Temporal.PlainYearMonth object with some
fields replaced by new values.
§Errors
Throws a TypeError if no recognised field is set, and a RangeError if values are out
of range or overflow is 'reject' and a field would need constraining.
Source§impl PlainYearMonth
impl PlainYearMonth
Sourcepub fn add(&self, duration: &Duration) -> Result<PlainYearMonth, RangeError>
pub fn add(&self, duration: &Duration) -> Result<PlainYearMonth, RangeError>
The add() method returns a new Temporal.PlainYearMonth object with the
duration added to this year-month.
§Errors
Throws a RangeError if the result is out of range, if overflow is 'reject' and a
field would need constraining, or if the duration has units smaller than a month.
Source§impl PlainYearMonth
impl PlainYearMonth
Sourcepub fn add_with_options(
&self,
duration: &Duration,
options: &OverflowOptions,
) -> Result<PlainYearMonth, RangeError>
pub fn add_with_options( &self, duration: &Duration, options: &OverflowOptions, ) -> Result<PlainYearMonth, RangeError>
The add() method returns a new Temporal.PlainYearMonth object with the
duration added to this year-month.
§Errors
Throws a RangeError if the result is out of range, if overflow is 'reject' and a
field would need constraining, or if the duration has units smaller than a month.
Source§impl PlainYearMonth
impl PlainYearMonth
Sourcepub fn add_with_duration_like(
&self,
duration: &DurationLike,
) -> Result<PlainYearMonth, Error>
pub fn add_with_duration_like( &self, duration: &DurationLike, ) -> Result<PlainYearMonth, Error>
The add() method taking a duration property bag.
§Errors
Throws a TypeError if no duration field is set; see PlainYearMonth::add for the remaining errors.
Source§impl PlainYearMonth
impl PlainYearMonth
Sourcepub fn add_with_duration_like_and_options(
&self,
duration: &DurationLike,
options: &OverflowOptions,
) -> Result<PlainYearMonth, Error>
pub fn add_with_duration_like_and_options( &self, duration: &DurationLike, options: &OverflowOptions, ) -> Result<PlainYearMonth, Error>
The add() method taking a duration property bag and options; see
PlainYearMonth::add_with_duration_like for errors.
Source§impl PlainYearMonth
impl PlainYearMonth
Sourcepub fn add_with_str_and_options(
&self,
duration: &str,
options: &OverflowOptions,
) -> Result<PlainYearMonth, RangeError>
pub fn add_with_str_and_options( &self, duration: &str, options: &OverflowOptions, ) -> Result<PlainYearMonth, RangeError>
The add() method taking an ISO 8601 duration string and options; see
PlainYearMonth::add_with_str for errors.
Source§impl PlainYearMonth
impl PlainYearMonth
Sourcepub fn add_with_str(&self, duration: &str) -> Result<PlainYearMonth, RangeError>
pub fn add_with_str(&self, duration: &str) -> Result<PlainYearMonth, RangeError>
The add() method taking an ISO 8601 duration string.
§Errors
Throws a RangeError if the string is not a valid duration; see PlainYearMonth::add for the remaining errors.
Source§impl PlainYearMonth
impl PlainYearMonth
Sourcepub fn subtract(
&self,
duration: &Duration,
) -> Result<PlainYearMonth, RangeError>
pub fn subtract( &self, duration: &Duration, ) -> Result<PlainYearMonth, RangeError>
The subtract() method returns a new Temporal.PlainYearMonth object with the
duration subtracted from this year-month.
§Errors
Throws a RangeError if the result is out of range, if overflow is 'reject' and a
field would need constraining, or if the duration has units smaller than a month.
Source§impl PlainYearMonth
impl PlainYearMonth
Sourcepub fn subtract_with_options(
&self,
duration: &Duration,
options: &OverflowOptions,
) -> Result<PlainYearMonth, RangeError>
pub fn subtract_with_options( &self, duration: &Duration, options: &OverflowOptions, ) -> Result<PlainYearMonth, RangeError>
The subtract() method returns a new Temporal.PlainYearMonth object with the
duration subtracted from this year-month.
§Errors
Throws a RangeError if the result is out of range, if overflow is 'reject' and a
field would need constraining, or if the duration has units smaller than a month.
Source§impl PlainYearMonth
impl PlainYearMonth
Sourcepub fn subtract_with_duration_like(
&self,
duration: &DurationLike,
) -> Result<PlainYearMonth, Error>
pub fn subtract_with_duration_like( &self, duration: &DurationLike, ) -> Result<PlainYearMonth, Error>
The subtract() method taking a duration property bag.
§Errors
Throws a TypeError if no duration field is set; see PlainYearMonth::subtract for the remaining errors.
Source§impl PlainYearMonth
impl PlainYearMonth
Sourcepub fn subtract_with_duration_like_and_options(
&self,
duration: &DurationLike,
options: &OverflowOptions,
) -> Result<PlainYearMonth, Error>
pub fn subtract_with_duration_like_and_options( &self, duration: &DurationLike, options: &OverflowOptions, ) -> Result<PlainYearMonth, Error>
The subtract() method taking a duration property bag and options; see
PlainYearMonth::subtract_with_duration_like for errors.
Source§impl PlainYearMonth
impl PlainYearMonth
Sourcepub fn subtract_with_str_and_options(
&self,
duration: &str,
options: &OverflowOptions,
) -> Result<PlainYearMonth, RangeError>
pub fn subtract_with_str_and_options( &self, duration: &str, options: &OverflowOptions, ) -> Result<PlainYearMonth, RangeError>
The subtract() method taking an ISO 8601 duration string and options; see
PlainYearMonth::subtract_with_str for errors.
Source§impl PlainYearMonth
impl PlainYearMonth
Sourcepub fn subtract_with_str(
&self,
duration: &str,
) -> Result<PlainYearMonth, RangeError>
pub fn subtract_with_str( &self, duration: &str, ) -> Result<PlainYearMonth, RangeError>
The subtract() method taking an ISO 8601 duration string.
§Errors
Throws a RangeError if the string is not a valid duration; see PlainYearMonth::subtract for the remaining errors.
Source§impl PlainYearMonth
impl PlainYearMonth
Sourcepub fn until(&self, other: &PlainYearMonth) -> Result<Duration, RangeError>
pub fn until(&self, other: &PlainYearMonth) -> Result<Duration, RangeError>
The until() method returns a Temporal.Duration representing the duration
from this year-month until other.
§Errors
Throws a RangeError if dates have different calendars or options are invalid.
Source§impl PlainYearMonth
impl PlainYearMonth
Sourcepub fn until_with_options(
&self,
other: &PlainYearMonth,
options: &DifferenceOptions,
) -> Result<Duration, RangeError>
pub fn until_with_options( &self, other: &PlainYearMonth, options: &DifferenceOptions, ) -> Result<Duration, RangeError>
The until() method returns a Temporal.Duration representing the duration
from this year-month until other.
§Errors
Throws a RangeError if dates have different calendars or options are invalid.
Source§impl PlainYearMonth
impl PlainYearMonth
Sourcepub fn since(&self, other: &PlainYearMonth) -> Result<Duration, RangeError>
pub fn since(&self, other: &PlainYearMonth) -> Result<Duration, RangeError>
The since() method returns a Temporal.Duration representing the duration
from other until this year-month.
§Errors
Throws a RangeError if dates have different calendars or options are invalid.
Source§impl PlainYearMonth
impl PlainYearMonth
Sourcepub fn until_with_plain_date(
&self,
other: &PlainDate,
) -> Result<Duration, RangeError>
pub fn until_with_plain_date( &self, other: &PlainDate, ) -> Result<Duration, RangeError>
The until() method taking a Temporal.PlainDate; see PlainYearMonth::until for errors.
Source§impl PlainYearMonth
impl PlainYearMonth
Sourcepub fn until_with_plain_date_and_options(
&self,
other: &PlainDate,
options: &DifferenceOptions,
) -> Result<Duration, RangeError>
pub fn until_with_plain_date_and_options( &self, other: &PlainDate, options: &DifferenceOptions, ) -> Result<Duration, RangeError>
The until() method taking a Temporal.PlainDate and options; see PlainYearMonth::until_with_options
for errors.
Source§impl PlainYearMonth
impl PlainYearMonth
Sourcepub fn until_with_plain_date_time(
&self,
other: &PlainDateTime,
) -> Result<Duration, RangeError>
pub fn until_with_plain_date_time( &self, other: &PlainDateTime, ) -> Result<Duration, RangeError>
The until() method taking a Temporal.PlainDateTime; see PlainYearMonth::until for errors.
Source§impl PlainYearMonth
impl PlainYearMonth
Sourcepub fn until_with_plain_date_time_and_options(
&self,
other: &PlainDateTime,
options: &DifferenceOptions,
) -> Result<Duration, RangeError>
pub fn until_with_plain_date_time_and_options( &self, other: &PlainDateTime, options: &DifferenceOptions, ) -> Result<Duration, RangeError>
The until() method taking a Temporal.PlainDateTime and options; see PlainYearMonth::until_with_options
for errors.
Source§impl PlainYearMonth
impl PlainYearMonth
Sourcepub fn until_with_zoned_date_time(
&self,
other: &ZonedDateTime,
) -> Result<Duration, RangeError>
pub fn until_with_zoned_date_time( &self, other: &ZonedDateTime, ) -> Result<Duration, RangeError>
The until() method taking a Temporal.ZonedDateTime; see PlainYearMonth::until for errors.
Source§impl PlainYearMonth
impl PlainYearMonth
Sourcepub fn until_with_zoned_date_time_and_options(
&self,
other: &ZonedDateTime,
options: &DifferenceOptions,
) -> Result<Duration, RangeError>
pub fn until_with_zoned_date_time_and_options( &self, other: &ZonedDateTime, options: &DifferenceOptions, ) -> Result<Duration, RangeError>
The until() method taking a Temporal.ZonedDateTime and options; see PlainYearMonth::until_with_options
for errors.
Source§impl PlainYearMonth
impl PlainYearMonth
Sourcepub fn until_with_plain_year_month_like(
&self,
other: &PlainYearMonthLike,
) -> Result<Duration, Error>
pub fn until_with_plain_year_month_like( &self, other: &PlainYearMonthLike, ) -> Result<Duration, Error>
The until() method taking a property bag; throws a TypeError if required fields are missing; see PlainYearMonth::until for the remaining errors.
Source§impl PlainYearMonth
impl PlainYearMonth
Sourcepub fn until_with_plain_year_month_like_and_options(
&self,
other: &PlainYearMonthLike,
options: &DifferenceOptions,
) -> Result<Duration, Error>
pub fn until_with_plain_year_month_like_and_options( &self, other: &PlainYearMonthLike, options: &DifferenceOptions, ) -> Result<Duration, Error>
The until() method taking a property bag and options; throws a TypeError if required
fields are missing. See PlainYearMonth::until_with_options for the remaining errors.
Source§impl PlainYearMonth
impl PlainYearMonth
Sourcepub fn until_with_str(&self, other: &str) -> Result<Duration, RangeError>
pub fn until_with_str(&self, other: &str) -> Result<Duration, RangeError>
The until() method taking an ISO 8601 string; throws a RangeError if the string is invalid; see PlainYearMonth::until for the remaining errors.
Source§impl PlainYearMonth
impl PlainYearMonth
Sourcepub fn until_with_str_and_options(
&self,
other: &str,
options: &DifferenceOptions,
) -> Result<Duration, RangeError>
pub fn until_with_str_and_options( &self, other: &str, options: &DifferenceOptions, ) -> Result<Duration, RangeError>
The until() method taking an ISO 8601 string and options; see PlainYearMonth::until_with_options
for errors.
Source§impl PlainYearMonth
impl PlainYearMonth
Sourcepub fn since_with_options(
&self,
other: &PlainYearMonth,
options: &DifferenceOptions,
) -> Result<Duration, RangeError>
pub fn since_with_options( &self, other: &PlainYearMonth, options: &DifferenceOptions, ) -> Result<Duration, RangeError>
The since() method returns a Temporal.Duration representing the duration
from other until this year-month.
§Errors
Throws a RangeError if dates have different calendars or options are invalid.
Source§impl PlainYearMonth
impl PlainYearMonth
Sourcepub fn to_plain_date_with_fields(
&self,
fields: &PlainDateFields,
) -> Result<PlainDate, Error>
pub fn to_plain_date_with_fields( &self, fields: &PlainDateFields, ) -> Result<PlainDate, Error>
The toPlainDate() method returns a Temporal.PlainDate object representing
this year-month with the given day.
§Errors
Throws a TypeError if day is not set and a RangeError if it is not a positive
integer. A day past the end of the month is constrained to the last day.
Source§impl PlainYearMonth
impl PlainYearMonth
Sourcepub fn since_with_plain_date(
&self,
other: &PlainDate,
) -> Result<Duration, RangeError>
pub fn since_with_plain_date( &self, other: &PlainDate, ) -> Result<Duration, RangeError>
The since() method taking a Temporal.PlainDate; see PlainYearMonth::since for errors.
Source§impl PlainYearMonth
impl PlainYearMonth
Sourcepub fn since_with_plain_date_and_options(
&self,
other: &PlainDate,
options: &DifferenceOptions,
) -> Result<Duration, RangeError>
pub fn since_with_plain_date_and_options( &self, other: &PlainDate, options: &DifferenceOptions, ) -> Result<Duration, RangeError>
The since() method taking a Temporal.PlainDate and options; see PlainYearMonth::since_with_options
for errors.
Source§impl PlainYearMonth
impl PlainYearMonth
Sourcepub fn since_with_plain_date_time(
&self,
other: &PlainDateTime,
) -> Result<Duration, RangeError>
pub fn since_with_plain_date_time( &self, other: &PlainDateTime, ) -> Result<Duration, RangeError>
The since() method taking a Temporal.PlainDateTime; see PlainYearMonth::since for errors.
Source§impl PlainYearMonth
impl PlainYearMonth
Sourcepub fn since_with_plain_date_time_and_options(
&self,
other: &PlainDateTime,
options: &DifferenceOptions,
) -> Result<Duration, RangeError>
pub fn since_with_plain_date_time_and_options( &self, other: &PlainDateTime, options: &DifferenceOptions, ) -> Result<Duration, RangeError>
The since() method taking a Temporal.PlainDateTime and options; see PlainYearMonth::since_with_options
for errors.
Source§impl PlainYearMonth
impl PlainYearMonth
Sourcepub fn since_with_zoned_date_time(
&self,
other: &ZonedDateTime,
) -> Result<Duration, RangeError>
pub fn since_with_zoned_date_time( &self, other: &ZonedDateTime, ) -> Result<Duration, RangeError>
The since() method taking a Temporal.ZonedDateTime; see PlainYearMonth::since for errors.
Source§impl PlainYearMonth
impl PlainYearMonth
Sourcepub fn since_with_zoned_date_time_and_options(
&self,
other: &ZonedDateTime,
options: &DifferenceOptions,
) -> Result<Duration, RangeError>
pub fn since_with_zoned_date_time_and_options( &self, other: &ZonedDateTime, options: &DifferenceOptions, ) -> Result<Duration, RangeError>
The since() method taking a Temporal.ZonedDateTime and options; see PlainYearMonth::since_with_options
for errors.
Source§impl PlainYearMonth
impl PlainYearMonth
Sourcepub fn since_with_plain_year_month_like(
&self,
other: &PlainYearMonthLike,
) -> Result<Duration, Error>
pub fn since_with_plain_year_month_like( &self, other: &PlainYearMonthLike, ) -> Result<Duration, Error>
The since() method taking a property bag; throws a TypeError if required fields are missing; see PlainYearMonth::since for the remaining errors.
Source§impl PlainYearMonth
impl PlainYearMonth
Sourcepub fn since_with_plain_year_month_like_and_options(
&self,
other: &PlainYearMonthLike,
options: &DifferenceOptions,
) -> Result<Duration, Error>
pub fn since_with_plain_year_month_like_and_options( &self, other: &PlainYearMonthLike, options: &DifferenceOptions, ) -> Result<Duration, Error>
The since() method taking a property bag and options; throws a TypeError if required
fields are missing. See PlainYearMonth::since_with_options for the remaining errors.
Source§impl PlainYearMonth
impl PlainYearMonth
Sourcepub fn since_with_str(&self, other: &str) -> Result<Duration, RangeError>
pub fn since_with_str(&self, other: &str) -> Result<Duration, RangeError>
The since() method taking an ISO 8601 string; throws a RangeError if the string is invalid; see PlainYearMonth::since for the remaining errors.
Source§impl PlainYearMonth
impl PlainYearMonth
Sourcepub fn since_with_str_and_options(
&self,
other: &str,
options: &DifferenceOptions,
) -> Result<Duration, RangeError>
pub fn since_with_str_and_options( &self, other: &str, options: &DifferenceOptions, ) -> Result<Duration, RangeError>
The since() method taking an ISO 8601 string and options; see PlainYearMonth::since_with_options
for errors.
Source§impl PlainYearMonth
impl PlainYearMonth
Sourcepub fn to_locale_string(&self) -> Result<JsString, RangeError>
pub fn to_locale_string(&self) -> Result<JsString, RangeError>
The toLocaleString() method returns a language-sensitive string representation
of this year-month.
§Errors
Throws a RangeError if locales is invalid or the locale’s calendar does
not match this value’s calendar.
Source§impl PlainYearMonth
impl PlainYearMonth
Sourcepub fn to_locale_string_with_str(
&self,
locales: &str,
) -> Result<JsString, RangeError>
pub fn to_locale_string_with_str( &self, locales: &str, ) -> Result<JsString, RangeError>
The toLocaleString() method; see PlainYearMonth::to_locale_string for errors.
Source§impl PlainYearMonth
impl PlainYearMonth
Sourcepub fn to_locale_string_with_str_sequence(
&self,
locales: &[JsString],
) -> Result<JsString, RangeError>
pub fn to_locale_string_with_str_sequence( &self, locales: &[JsString], ) -> Result<JsString, RangeError>
The toLocaleString() method; see PlainYearMonth::to_locale_string for errors.
Source§impl PlainYearMonth
impl PlainYearMonth
Sourcepub fn to_locale_string_with_str_sequence_and_options(
&self,
locales: &[JsString],
options: &DateTimeFormatOptions,
) -> Result<JsString, Error>
pub fn to_locale_string_with_str_sequence_and_options( &self, locales: &[JsString], options: &DateTimeFormatOptions, ) -> Result<JsString, Error>
The toLocaleString() method with options; throws a TypeError if an option does not
apply to this type or conflicts with another. See PlainYearMonth::to_locale_string for the
remaining errors.
Source§impl PlainYearMonth
impl PlainYearMonth
Sourcepub fn to_locale_string_with_options(
&self,
locales: Option<&str>,
options: &DateTimeFormatOptions,
) -> Result<JsString, Error>
pub fn to_locale_string_with_options( &self, locales: Option<&str>, options: &DateTimeFormatOptions, ) -> Result<JsString, Error>
The toLocaleString() method with options; None for locales uses the default locale.
Throws a TypeError if an option does not apply to this type or conflicts with another.
See PlainYearMonth::to_locale_string for the remaining errors.
Source§impl PlainYearMonth
impl PlainYearMonth
Source§impl PlainYearMonth
impl PlainYearMonth
Sourcepub fn to_js_string(&self) -> JsString
pub fn to_js_string(&self) -> JsString
The toString() method returns an RFC 9557 string representation of this year-month.
Source§impl PlainYearMonth
impl PlainYearMonth
Sourcepub fn to_js_string_with_options(
&self,
options: &ShowCalendarOptions,
) -> Result<JsString, RangeError>
pub fn to_js_string_with_options( &self, options: &ShowCalendarOptions, ) -> Result<JsString, RangeError>
The toString() method returns an RFC 9557 string representation of this year-month,
formatted according to options.
§Errors
Throws a RangeError if the options are invalid for this type.
Source§impl PlainYearMonth
impl PlainYearMonth
Sourcepub fn to_plain_date(&self, day: u32) -> Result<PlainDate, RangeError>
pub fn to_plain_date(&self, day: u32) -> Result<PlainDate, RangeError>
The toPlainDate() method returns a Temporal.PlainDate object representing
this year-month on the given day of the month; see PlainYearMonth::to_plain_date_with_fields for errors.
Methods from Deref<Target = Object>§
Sourcepub fn constructor(&self) -> Function
pub fn constructor(&self) -> Function
The constructor property returns a reference to the Object constructor
function that created the instance object.
Sourcepub fn has_own_property(&self, property: &JsValue) -> bool
👎Deprecated: Use Object::hasOwn instead.
pub fn has_own_property(&self, property: &JsValue) -> bool
Use Object::hasOwn instead.
The hasOwnProperty() method returns a boolean indicating whether the
object has the specified property as its own property (as opposed to
inheriting it).
Sourcepub fn is_prototype_of(&self, value: &JsValue) -> bool
pub fn is_prototype_of(&self, value: &JsValue) -> bool
The isPrototypeOf() method checks if an object exists in another
object’s prototype chain.
Sourcepub fn property_is_enumerable(&self, property: &JsValue) -> bool
pub fn property_is_enumerable(&self, property: &JsValue) -> bool
The propertyIsEnumerable() method returns a Boolean indicating
whether the specified property is enumerable.
Sourcepub fn to_locale_string(&self) -> JsString
pub fn to_locale_string(&self) -> JsString
The toLocaleString() method returns a string representing the object.
This method is meant to be overridden by derived objects for
locale-specific purposes.
Sourcepub fn to_string(&self) -> JsString
pub fn to_string(&self) -> JsString
The toString() method returns a string representing the object.
Sourcepub fn to_js_string(&self) -> JsString
pub fn to_js_string(&self) -> JsString
The toString() method returns a string representing the object.
Methods from Deref<Target = JsValue>§
Sourcepub fn as_f64(&self) -> Option<f64>
pub fn as_f64(&self) -> Option<f64>
Returns the f64 value of this JS value if it’s an instance of a
number.
If this JS value is not an instance of a number then this returns
None.
Sourcepub fn as_string(&self) -> Option<String>
pub fn as_string(&self) -> Option<String>
If this JS value is a string value, this function copies the JS string
value into Wasm linear memory, encoded as UTF-8, and returns it as a
Rust String.
To avoid the copying and re-encoding, consider the
JsString::try_from() function from js-sys
instead.
If this JS value is not an instance of a string or if it’s not valid
utf-8 then this returns None.
§UTF-16 vs UTF-8
JavaScript strings in general are encoded as UTF-16, but Rust strings
are encoded as UTF-8. This can cause the Rust string to look a bit
different than the JS string sometimes. For more details see the
documentation about the str type which contains a few
caveats about the encodings.
Sourcepub fn as_bool(&self) -> Option<bool>
pub fn as_bool(&self) -> Option<bool>
Returns the bool value of this JS value if it’s an instance of a
boolean.
If this JS value is not an instance of a boolean then this returns
None.
Sourcepub fn is_undefined(&self) -> bool
pub fn is_undefined(&self) -> bool
Tests whether this JS value is undefined
Sourcepub fn is_null_or_undefined(&self) -> bool
pub fn is_null_or_undefined(&self) -> bool
Tests whether this JS value is null or undefined
Sourcepub fn is_function(&self) -> bool
pub fn is_function(&self) -> bool
Tests whether the type of this JS value is function.
Sourcepub fn js_in(&self, obj: &JsValue) -> bool
pub fn js_in(&self, obj: &JsValue) -> bool
Applies the binary in JS operator on the two JsValues.
Sourcepub fn loose_eq(&self, other: &JsValue) -> bool
pub fn loose_eq(&self, other: &JsValue) -> bool
Compare two JsValues for equality, using the == operator in JS.
Sourcepub fn unsigned_shr(&self, rhs: &JsValue) -> u32
pub fn unsigned_shr(&self, rhs: &JsValue) -> u32
Applies the binary >>> JS operator on the two JsValues.
Sourcepub fn checked_div(&self, rhs: &JsValue) -> JsValue
pub fn checked_div(&self, rhs: &JsValue) -> JsValue
Applies the binary / JS operator on two JsValues, catching and returning any RangeError thrown.
Sourcepub fn pow(&self, rhs: &JsValue) -> JsValue
pub fn pow(&self, rhs: &JsValue) -> JsValue
Applies the binary ** JS operator on the two JsValues.
Sourcepub fn lt(&self, other: &JsValue) -> bool
pub fn lt(&self, other: &JsValue) -> bool
Applies the binary < JS operator on the two JsValues.
Sourcepub fn le(&self, other: &JsValue) -> bool
pub fn le(&self, other: &JsValue) -> bool
Applies the binary <= JS operator on the two JsValues.
Sourcepub fn ge(&self, other: &JsValue) -> bool
pub fn ge(&self, other: &JsValue) -> bool
Applies the binary >= JS operator on the two JsValues.
Sourcepub fn gt(&self, other: &JsValue) -> bool
pub fn gt(&self, other: &JsValue) -> bool
Applies the binary > JS operator on the two JsValues.
Sourcepub fn unchecked_into_f64(&self) -> f64
pub fn unchecked_into_f64(&self) -> f64
Applies the unary + JS operator on a JsValue. Can throw.
Trait Implementations§
Source§impl AsRef<JsValue> for PlainYearMonth
impl AsRef<JsValue> for PlainYearMonth
Source§impl AsRef<Object> for PlainYearMonth
impl AsRef<Object> for PlainYearMonth
Source§impl AsRef<PlainYearMonth> for PlainYearMonth
impl AsRef<PlainYearMonth> for PlainYearMonth
Source§fn as_ref(&self) -> &PlainYearMonth
fn as_ref(&self) -> &PlainYearMonth
Source§impl Clone for PlainYearMonth
impl Clone for PlainYearMonth
Source§impl Debug for PlainYearMonth
impl Debug for PlainYearMonth
Source§impl Deref for PlainYearMonth
impl Deref for PlainYearMonth
impl Eq for PlainYearMonth
Source§impl ErasableGeneric for PlainYearMonth
impl ErasableGeneric for PlainYearMonth
Source§impl From<JsValue> for PlainYearMonth
impl From<JsValue> for PlainYearMonth
Source§impl From<PlainYearMonth> for JsValue
impl From<PlainYearMonth> for JsValue
Source§fn from(obj: PlainYearMonth) -> JsValue
fn from(obj: PlainYearMonth) -> JsValue
Source§impl From<PlainYearMonth> for Object
impl From<PlainYearMonth> for Object
Source§fn from(obj: PlainYearMonth) -> Object
fn from(obj: PlainYearMonth) -> Object
Source§impl FromWasmAbi for PlainYearMonth
impl FromWasmAbi for PlainYearMonth
Source§impl IntoJsGeneric for PlainYearMonthwhere
PlainYearMonth: JsGeneric,
impl IntoJsGeneric for PlainYearMonthwhere
PlainYearMonth: JsGeneric,
Source§type JsCanon = PlainYearMonth
type JsCanon = PlainYearMonth
JsGeneric form of this type.Source§fn to_js(self) -> PlainYearMonth
fn to_js(self) -> PlainYearMonth
JsGeneric value for self.Source§impl IntoWasmAbi for PlainYearMonth
impl IntoWasmAbi for PlainYearMonth
Source§impl<'__wbg_ref> IntoWasmAbi for &'__wbg_ref PlainYearMonth
impl<'__wbg_ref> IntoWasmAbi for &'__wbg_ref PlainYearMonth
Source§impl JsCast for PlainYearMonth
impl JsCast for PlainYearMonth
Source§fn instanceof(val: &JsValue) -> bool
fn instanceof(val: &JsValue) -> bool
instanceof check to see whether the JsValue
provided is an instance of this type. Read moreSource§fn unchecked_from_js(val: JsValue) -> Self
fn unchecked_from_js(val: JsValue) -> Self
Source§fn unchecked_from_js_ref(val: &JsValue) -> &Self
fn unchecked_from_js_ref(val: &JsValue) -> &Self
Source§fn has_type<T>(&self) -> boolwhere
T: JsCast,
fn has_type<T>(&self) -> boolwhere
T: JsCast,
T. Read moreSource§fn dyn_into<T>(self) -> Result<T, Self>where
T: JsCast,
fn dyn_into<T>(self) -> Result<T, Self>where
T: JsCast,
T. Read moreSource§fn dyn_ref<T>(&self) -> Option<&T>where
T: JsCast,
fn dyn_ref<T>(&self) -> Option<&T>where
T: JsCast,
T. Read moreSource§fn unchecked_into<T>(self) -> Twhere
T: JsCast,
fn unchecked_into<T>(self) -> Twhere
T: JsCast,
Source§fn unchecked_ref<T>(&self) -> &Twhere
T: JsCast,
fn unchecked_ref<T>(&self) -> &Twhere
T: JsCast,
Source§impl LongRefFromWasmAbi for PlainYearMonth
impl LongRefFromWasmAbi for PlainYearMonth
Source§type Anchor = PlainYearMonth
type Anchor = PlainYearMonth
RefFromWasmAbi::AnchorSource§unsafe fn long_ref_from_abi(js: Self::Abi) -> Self::Anchor
unsafe fn long_ref_from_abi(js: Self::Abi) -> Self::Anchor
RefFromWasmAbi::ref_from_abiSource§impl NullableFromWasmAbi for PlainYearMonth
impl NullableFromWasmAbi for PlainYearMonth
Source§impl NullableIntoWasmAbi for PlainYearMonth
impl NullableIntoWasmAbi for PlainYearMonth
Source§impl<'__wbg_ref> NullableIntoWasmAbi for &'__wbg_ref PlainYearMonth
impl<'__wbg_ref> NullableIntoWasmAbi for &'__wbg_ref PlainYearMonth
Source§impl OptionFromWasmAbi for PlainYearMonth
impl OptionFromWasmAbi for PlainYearMonth
Source§impl OptionIntoWasmAbi for PlainYearMonth
impl OptionIntoWasmAbi for PlainYearMonth
Source§impl<'__wbg_ref> OptionIntoWasmAbi for &'__wbg_ref PlainYearMonth
impl<'__wbg_ref> OptionIntoWasmAbi for &'__wbg_ref PlainYearMonth
Source§impl PartialEq for PlainYearMonth
impl PartialEq for PlainYearMonth
Source§impl Promising for PlainYearMonth
impl Promising for PlainYearMonth
Source§type Resolution = PlainYearMonth
type Resolution = PlainYearMonth
Source§impl RefFromWasmAbi for PlainYearMonth
impl RefFromWasmAbi for PlainYearMonth
Source§type Abi = <JsValue as RefFromWasmAbi>::Abi
type Abi = <JsValue as RefFromWasmAbi>::Abi
Self are recovered from.Source§type Anchor = ManuallyDrop<PlainYearMonth>
type Anchor = ManuallyDrop<PlainYearMonth>
Self for the duration of the
invocation of the function that has an &Self parameter. This is
required to ensure that the lifetimes don’t persist beyond one function
call, and so that they remain anonymous.impl UpcastFrom<PlainYearMonth> for JsValue
impl UpcastFrom<PlainYearMonth> for JsOption<JsValue>
impl UpcastFrom<PlainYearMonth> for JsNullable<JsValue>
impl<__UpcastWrapTarget> UpcastFrom<PlainYearMonth> for Option<__UpcastWrapTarget>where
__UpcastWrapTarget: UpcastFrom<PlainYearMonth>,
impl<__UpcastWrapTarget> UpcastFrom<PlainYearMonth> for Nullable<__UpcastWrapTarget>where
__UpcastWrapTarget: UpcastFrom<PlainYearMonth>,
impl UpcastFrom<PlainYearMonth> for PlainYearMonth
impl UpcastFrom<PlainYearMonth> for JsOption<PlainYearMonth>
impl UpcastFrom<PlainYearMonth> for JsNullable<PlainYearMonth>
impl UpcastFrom<PlainYearMonth> for Object
impl UpcastFrom<PlainYearMonth> for JsOption<Object>
impl UpcastFrom<PlainYearMonth> for JsNullable<Object>
Source§impl VectorRefIntoWasmAbi for PlainYearMonth
impl VectorRefIntoWasmAbi for PlainYearMonth
fn slice_into_abi(slice: &[Self]) -> WasmSlice
impl VectorRefIntoWasmAbiSealed for PlainYearMonth
Auto Trait Implementations§
impl Forget for PlainYearMonth
impl Freeze for PlainYearMonth
impl Move for PlainYearMonth
impl RefUnwindSafe for PlainYearMonth
impl Send for PlainYearMonth
impl Sync for PlainYearMonth
impl Unpin for PlainYearMonth
impl UnsafeUnpin for PlainYearMonth
impl UnwindSafe for PlainYearMonth
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,
impl<T> JsGeneric for T
Source§impl<T> MaybeFromWasmAbi for Twhere
T: OptionFromWasmAbi,
impl<T> MaybeFromWasmAbi for Twhere
T: OptionFromWasmAbi,
Source§type MaybeAbi = <T as FromWasmAbi>::Abi
type MaybeAbi = <T as FromWasmAbi>::Abi
Option<Self>.Source§unsafe fn from_maybe_abi(js: <T as FromWasmAbi>::Abi) -> T
unsafe fn from_maybe_abi(js: <T as FromWasmAbi>::Abi) -> T
unsafe fn try_from_maybe_abi( js: <T as FromWasmAbi>::Abi, ) -> Result<T, &'static str>
Source§impl<T> MaybeIntoWasmAbi for Twhere
T: OptionIntoWasmAbi,
impl<T> MaybeIntoWasmAbi for Twhere
T: OptionIntoWasmAbi,
Source§type MaybeAbi = <T as IntoWasmAbi>::Abi
type MaybeAbi = <T as IntoWasmAbi>::Abi
Option<Self>.Source§fn into_maybe_abi(self) -> <T as IntoWasmAbi>::Abi
fn into_maybe_abi(self) -> <T as IntoWasmAbi>::Abi
Option<Self> ABI.Source§impl<T, A> RefIntoWasmAbi for T
impl<T, A> RefIntoWasmAbi for T
Source§fn describe_ref()
fn describe_ref()
&Self.Source§fn ref_into_abi(&self) -> A
fn ref_into_abi(&self) -> A
&self into Self::Abi.Source§impl<T> ReturnWasmAbi for Twhere
T: IntoWasmAbi,
impl<T> ReturnWasmAbi for Twhere
T: IntoWasmAbi,
Source§type Abi = <T as IntoWasmAbi>::Abi
type Abi = <T as IntoWasmAbi>::Abi
IntoWasmAbi::AbiSource§fn return_abi(self) -> <T as ReturnWasmAbi>::Abi
fn return_abi(self) -> <T as ReturnWasmAbi>::Abi
IntoWasmAbi::into_abi, except that it may throw and never
return in the case of Err.