pub struct Date { /* private fields */ }Implementations§
Source§impl Date
impl Date
pub fn is_leap_year(year: i32) -> bool
pub fn days_in_month(year: i32, month: u32) -> u32
Source§impl Date
impl Date
pub fn new(year: i32, month: u32, day: u32) -> Option<Self>
pub fn from_ymd(year: i32, month: u32, day: u32) -> Result<Self, Box<TypeError>>
pub fn year(&self) -> i32
pub fn month(&self) -> u32
pub fn day(&self) -> u32
pub fn to_days_since_epoch(&self) -> i32
pub fn from_days_since_epoch(days: i32) -> Option<Self>
pub fn saturating_add(self, rhs: Duration) -> Date
pub fn saturating_sub(self, rhs: Duration) -> Date
Trait Implementations§
impl Copy for Date
Source§impl<'de> Deserialize<'de> for Date
impl<'de> Deserialize<'de> for Date
Source§fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for Date
impl IsDate for Date
impl IsTemporal for Date
Source§impl Ord for Date
impl Ord for Date
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialOrd for Date
impl PartialOrd for Date
impl StructuralPartialEq for Date
Source§impl TryFromValue for Date
impl TryFromValue for Date
fn try_from_value(value: &Value) -> Result<Self, FromValueError>
fn from_value(value: &Value) -> Option<Self>
Source§impl TryFromValueCoerce for Date
impl TryFromValueCoerce for Date
fn try_from_value_coerce(value: &Value) -> Result<Self, FromValueError>
fn from_value_coerce(value: &Value) -> Option<Self>
Auto Trait Implementations§
impl Freeze for Date
impl RefUnwindSafe for Date
impl Send for Date
impl Sync for Date
impl Unpin for Date
impl UnsafeUnpin 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