pub struct Day(/* private fields */);
Expand description
The Day
struct. Holds a u8 because there’s no 255 days.
On substractions it’s value is casted to a i16 to allow for an ample range of negatives, and then casted to u8 again on construction.
Implementations§
Source§impl Day
impl Day
Sourcepub fn new(value: u8) -> Result<Self, DateErrors>
pub fn new(value: u8) -> Result<Self, DateErrors>
Returns a new Day
struct, or an Err of DateErrors
if it exceeds 31.
Trait Implementations§
impl Eq for Day
impl StructuralPartialEq for Day
Auto Trait Implementations§
impl Freeze for Day
impl RefUnwindSafe for Day
impl Send for Day
impl Sync for Day
impl Unpin for Day
impl UnwindSafe for Day
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