pub struct NthWeekdayOfMonth(/* private fields */);Expand description
The supported range of values for getting the “nth weekday of a month” from a particular date.
Note that 0 is also invalid, but this is not expressed by
this single contiguous range. Note also that 5 or -5 can be invalid
if the provided month does not contain a 5th instance of the weekday
provided by the caller.
Implementations§
Source§impl NthWeekdayOfMonth
impl NthWeekdayOfMonth
pub const MIN: i8 = <NthWeekdayOfMonth as Bounds>::MIN
pub const MAX: i8 = <NthWeekdayOfMonth as Bounds>::MAX
pub const LEN: i128
pub const fn error() -> BoundsError
pub fn check(n: impl Into<i64>) -> Result<i8, BoundsError>
pub const fn checkc(n: i64) -> Result<i8, BoundsError>
pub const fn checked_add(n1: i8, n2: i8) -> Result<i8, BoundsError>
pub fn checked_mul(n1: i8, n2: i8) -> Result<i8, BoundsError>
Trait Implementations§
Source§impl Bounds for NthWeekdayOfMonth
impl Bounds for NthWeekdayOfMonth
Source§const WHAT: &'static str = "nth weekday of month"
const WHAT: &'static str = "nth weekday of month"
A short human readable description of the values represented by these
bounds. This is used in error messages.
Source§type Error = BoundsError
type Error = BoundsError
The error type returned when a value is considered out of range for
this particular implementation. Read more
Source§fn error() -> BoundsError
fn error() -> BoundsError
Create an error when a value is outside the bounds for this type.
Source§fn check(n: impl Into<i64>) -> Result<Self::Primitive, Self::Error>
fn check(n: impl Into<i64>) -> Result<Self::Primitive, Self::Error>
Converts the 64-bit integer provided into the primitive representation
of these bounds. Read more
Source§fn check_self(n: Self::Primitive) -> Result<Self::Primitive, Self::Error>
fn check_self(n: Self::Primitive) -> Result<Self::Primitive, Self::Error>
Checks whether the given integer, in the same primitive representation
as this boundary type, is in bounds. Read more
impl Eq for NthWeekdayOfMonth
Source§impl PartialEq for NthWeekdayOfMonth
impl PartialEq for NthWeekdayOfMonth
impl StructuralPartialEq for NthWeekdayOfMonth
Auto Trait Implementations§
impl Freeze for NthWeekdayOfMonth
impl RefUnwindSafe for NthWeekdayOfMonth
impl Send for NthWeekdayOfMonth
impl Sync for NthWeekdayOfMonth
impl Unpin for NthWeekdayOfMonth
impl UnsafeUnpin for NthWeekdayOfMonth
impl UnwindSafe for NthWeekdayOfMonth
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