pub struct Date(/* private fields */);
Expand description
Ways to specify a date.
use nextver::Date;
let utc_now = Date::utc_now();
let local_now = Date::local_now();
let explicit = Date::explicit(2021, 2, 3).unwrap();
Implementations§
Trait Implementations§
source§impl FromStr for Date
impl FromStr for Date
source§fn from_str(s: &str) -> Result<Self, Self::Err>
fn from_str(s: &str) -> Result<Self, Self::Err>
Parses a date string into a Date
. The string must be in the format YYYY-MM-DD
, where
YYYY
is the year zero-padded to 4 digits, MM
is the month zero-padded to 2 digits, and
DD
is the day zero-padded to 2 digits.
See NaiveDate::from_str
.
§Errors
Returns a DateError::UnparseableDate
if the date string is not parseable.
source§impl PartialEq for Date
impl PartialEq for Date
impl Copy for Date
impl StructuralPartialEq for Date
Auto Trait Implementations§
impl RefUnwindSafe for Date
impl Send for Date
impl Sync for Date
impl Unpin for Date
impl UnwindSafe for Date
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