pub struct NaturalDate(/* private fields */);Expand description
序列化为 YYYY-MM-DD 的已校验公历自然日。
Implementations§
Source§impl NaturalDate
impl NaturalDate
pub fn parse(value: &str) -> Result<Self, ValidationError>
Trait Implementations§
Source§impl Clone for NaturalDate
impl Clone for NaturalDate
impl Copy for NaturalDate
Source§impl Debug for NaturalDate
impl Debug for NaturalDate
Source§impl<'de> Deserialize<'de> for NaturalDate
impl<'de> Deserialize<'de> for NaturalDate
Source§fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
Deserialize this value from the given Serde deserializer. Read more
Source§impl Display for NaturalDate
impl Display for NaturalDate
impl Eq for NaturalDate
Source§impl From<&NaturalDate> for OptionalInput<NaturalDate>
impl From<&NaturalDate> for OptionalInput<NaturalDate>
Source§fn from(value: &NaturalDate) -> Self
fn from(value: &NaturalDate) -> Self
Converts to this type from the input type.
Source§impl From<&NaturalDate> for NaturalDate
impl From<&NaturalDate> for NaturalDate
Source§fn from(value: &NaturalDate) -> Self
fn from(value: &NaturalDate) -> Self
Converts to this type from the input type.
Source§impl From<Date> for NaturalDate
impl From<Date> for NaturalDate
Source§impl FromStr for NaturalDate
impl FromStr for NaturalDate
Source§impl Hash for NaturalDate
impl Hash for NaturalDate
Source§impl Ord for NaturalDate
impl Ord for NaturalDate
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
1.21.0 (const: unstable) · Source§fn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the minimum of two values. Read more
Source§impl PartialEq for NaturalDate
impl PartialEq for NaturalDate
Source§impl PartialOrd for NaturalDate
impl PartialOrd for NaturalDate
Source§impl Serialize for NaturalDate
impl Serialize for NaturalDate
impl StructuralPartialEq for NaturalDate
Source§impl TryFrom<&String> for NaturalDate
impl TryFrom<&String> for NaturalDate
Source§impl TryFrom<&str> for NaturalDate
impl TryFrom<&str> for NaturalDate
Source§impl TryFrom<NaturalDate> for ShanghaiDateMillis
impl TryFrom<NaturalDate> for ShanghaiDateMillis
Source§type Error = ValidationError
type Error = ValidationError
The type returned in the event of a conversion error.
Auto Trait Implementations§
impl Freeze for NaturalDate
impl RefUnwindSafe for NaturalDate
impl Send for NaturalDate
impl Sync for NaturalDate
impl Unpin for NaturalDate
impl UnsafeUnpin for NaturalDate
impl UnwindSafe for NaturalDate
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