pub struct NaiveDateTimeWithoutYear<C: ParseContext> {
pub context: C,
pub month: u8,
pub day: u8,
pub hour: u8,
pub minute: u8,
pub second: u8,
}Fields§
§context: C§month: u8§day: u8§hour: u8§minute: u8§second: u8Implementations§
Source§impl<C: ParseContext> NaiveDateTimeWithoutYear<C>
impl<C: ParseContext> NaiveDateTimeWithoutYear<C>
pub fn with_year(self, year: i32) -> Result<NaiveDateTime, ParseError<C>>
pub fn into_naive_date_time(self) -> Result<NaiveDateTime, ParseError<C>>
Sourcepub fn compare<C2: ParseContext>(
&self,
other: &NaiveDateTimeWithoutYear<C2>,
) -> Ordering
pub fn compare<C2: ParseContext>( &self, other: &NaiveDateTimeWithoutYear<C2>, ) -> Ordering
Whether self come before or after other or is the same,
assuming the same year and that the dates are valid for that
assumed year. NaiveDateTimeWithoutYear is not implementing
Ord / PartialOrd because those also require PartialEq and it’s
unclear whether that should include position or not, also
ordering is easily misunderstood, too, since year is actually
unknown.
Trait Implementations§
Source§impl<C: Clone + ParseContext> Clone for NaiveDateTimeWithoutYear<C>
impl<C: Clone + ParseContext> Clone for NaiveDateTimeWithoutYear<C>
Source§fn clone(&self) -> NaiveDateTimeWithoutYear<C>
fn clone(&self) -> NaiveDateTimeWithoutYear<C>
Returns a copy 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<C: Debug + ParseContext> Debug for NaiveDateTimeWithoutYear<C>
impl<C: Debug + ParseContext> Debug for NaiveDateTimeWithoutYear<C>
Source§impl<C: ParseContext> Display for NaiveDateTimeWithoutYear<C>
impl<C: ParseContext> Display for NaiveDateTimeWithoutYear<C>
Source§impl From<&NaiveDateTime> for NaiveDateTimeWithoutYear<NoContext>
Note: uses position 0 always!
impl From<&NaiveDateTime> for NaiveDateTimeWithoutYear<NoContext>
Note: uses position 0 always!
Source§fn from(value: &NaiveDateTime) -> Self
fn from(value: &NaiveDateTime) -> Self
Converts to this type from the input type.
Source§impl<'s, B: Backing> IntoOwningBacking<<B as ToOwned>::Owned> for NaiveDateTimeWithoutYear<StringParseContext<&'s B>>
impl<'s, B: Backing> IntoOwningBacking<<B as ToOwned>::Owned> for NaiveDateTimeWithoutYear<StringParseContext<&'s B>>
type Owning = NaiveDateTimeWithoutYear<StringParseContext<<B as ToOwned>::Owned>>
fn into_owning_backing(self) -> Self::Owning
Auto Trait Implementations§
impl<C> Freeze for NaiveDateTimeWithoutYear<C>where
C: Freeze,
impl<C> RefUnwindSafe for NaiveDateTimeWithoutYear<C>where
C: RefUnwindSafe,
impl<C> Send for NaiveDateTimeWithoutYear<C>where
C: Send,
impl<C> Sync for NaiveDateTimeWithoutYear<C>where
C: Sync,
impl<C> Unpin for NaiveDateTimeWithoutYear<C>where
C: Unpin,
impl<C> UnwindSafe for NaiveDateTimeWithoutYear<C>where
C: UnwindSafe,
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