pub struct DateString(pub String);Expand description
A string that represent a date.
This exists for a few reasons:
- Musicbrainz can return incomplete dates (Ex: “1965” or “2023-06”)
- Allows for easy roundtrip
- Custom deserializers are expensive
- Allows for custom default values
Tuple Fields§
§0: StringImplementations§
Source§impl DateString
impl DateString
Trait Implementations§
Source§impl Clone for DateString
impl Clone for DateString
Source§fn clone(&self) -> DateString
fn clone(&self) -> DateString
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for DateString
impl Debug for DateString
Source§impl Default for DateString
impl Default for DateString
Source§fn default() -> DateString
fn default() -> DateString
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for DateString
impl<'de> Deserialize<'de> for DateString
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
Source§impl From<DateString> for String
impl From<DateString> for String
Source§fn from(value: DateString) -> Self
fn from(value: DateString) -> Self
Converts to this type from the input type.
Source§impl<T: Display> From<T> for DateString
impl<T: Display> From<T> for DateString
Source§impl PartialEq for DateString
impl PartialEq for DateString
Source§impl Serialize for DateString
impl Serialize for DateString
impl Eq for DateString
impl StructuralPartialEq for DateString
Auto Trait Implementations§
impl Freeze for DateString
impl RefUnwindSafe for DateString
impl Send for DateString
impl Sync for DateString
impl Unpin for DateString
impl UnsafeUnpin for DateString
impl UnwindSafe for DateString
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