pub enum DatePatternContext {
Local(DateTime<Local>),
Fixed(DateTime<FixedOffset>),
}Expand description
Context needed to create a DatePattern during revset evaluation.
Variants§
Local(DateTime<Local>)
Interpret date patterns using the local machine’s time zone
Fixed(DateTime<FixedOffset>)
Interpret date patterns using any FixedOffset time zone
Implementations§
Source§impl DatePatternContext
impl DatePatternContext
Sourcepub fn parse_relative(
&self,
s: &str,
kind: &str,
) -> Result<DatePattern, DatePatternParseError>
pub fn parse_relative( &self, s: &str, kind: &str, ) -> Result<DatePattern, DatePatternParseError>
Parses a DatePattern from the given string and kind.
Trait Implementations§
Source§impl Clone for DatePatternContext
impl Clone for DatePatternContext
Source§fn clone(&self) -> DatePatternContext
fn clone(&self) -> DatePatternContext
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 Debug for DatePatternContext
impl Debug for DatePatternContext
Source§impl From<DateTime<FixedOffset>> for DatePatternContext
impl From<DateTime<FixedOffset>> for DatePatternContext
Source§fn from(value: DateTime<FixedOffset>) -> Self
fn from(value: DateTime<FixedOffset>) -> Self
Converts to this type from the input type.
impl Copy for DatePatternContext
Auto Trait Implementations§
impl Freeze for DatePatternContext
impl RefUnwindSafe for DatePatternContext
impl Send for DatePatternContext
impl Sync for DatePatternContext
impl Unpin for DatePatternContext
impl UnwindSafe for DatePatternContext
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<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more