pub struct Date(/* private fields */);Implementations§
Source§impl Date
impl Date
Sourcepub fn try_new(y: i32, m: u8, d: u8) -> Option<Date>
pub fn try_new(y: i32, m: u8, d: u8) -> Option<Date>
Build a date from exact calendar parts.
Returns None when any component is out of range.
Sourcepub const fn from_days_since_epoch(days: i32) -> Date
pub const fn from_days_since_epoch(days: i32) -> Date
Construct directly from internal day-count representation.
Sourcepub const fn as_days_since_epoch(self) -> i32
pub const fn as_days_since_epoch(self) -> i32
Return the internal day-count representation.
Sourcepub fn try_from_i64(days: i64) -> Option<Date>
pub fn try_from_i64(days: i64) -> Option<Date>
Fallible conversion from i64 day-count representation.
Sourcepub fn try_from_u64(days: u64) -> Option<Date>
pub fn try_from_u64(days: u64) -> Option<Date>
Fallible conversion from u64 day-count representation.
Trait Implementations§
Source§impl AddAssign for Date
impl AddAssign for Date
Source§fn add_assign(&mut self, __rhs: Date)
fn add_assign(&mut self, __rhs: Date)
Performs the
+= operation. Read moreSource§impl CandidType for Date
impl CandidType for Date
impl Copy for Date
Source§impl<'de> Deserialize<'de> for Date
impl<'de> Deserialize<'de> for Date
Source§fn deserialize<D>(
deserializer: D,
) -> Result<Date, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
fn deserialize<D>(
deserializer: D,
) -> Result<Date, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for Date
Source§impl NormalizeAuto for Date
impl NormalizeAuto for Date
fn normalize_self(&mut self, _ctx: &mut dyn VisitorContext)
Source§impl NormalizeCustom for Date
impl NormalizeCustom for Date
fn normalize_custom(&mut self, _ctx: &mut dyn VisitorContext)
Source§impl NumericValue for Date
impl NumericValue 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
Source§impl Serialize for Date
impl Serialize for Date
Source§fn serialize<S>(
&self,
serializer: S,
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where
S: Serializer,
fn serialize<S>(
&self,
serializer: S,
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where
S: Serializer,
Serialize this value into the given Serde serializer. Read more
impl StructuralPartialEq for Date
Source§impl SubAssign for Date
impl SubAssign for Date
Source§fn sub_assign(&mut self, __rhs: Date)
fn sub_assign(&mut self, __rhs: Date)
Performs the
-= operation. Read moreSource§impl ValidateAuto for Date
impl ValidateAuto for Date
fn validate_self(&self, _ctx: &mut dyn VisitorContext)
Source§impl ValidateCustom for Date
impl ValidateCustom for Date
fn validate_custom(&self, _ctx: &mut dyn VisitorContext)
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
Source§impl<T> CustomError for T
impl<T> CustomError for T
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.impl<T> Normalize for Twhere
T: NormalizeAuto + NormalizeCustom,
Source§impl<T> NormalizeAndValidate for Twhere
T: Visitable,
impl<T> NormalizeAndValidate for Twhere
T: Visitable,
Source§fn normalize_and_validate(self) -> Result<Self, VisitorError>
fn normalize_and_validate(self) -> Result<Self, VisitorError>
Normalize and then validate this application-owned value. Read more