pub enum Day {
DaysFromStart(f64),
CalendarDate(Date),
CalendarWeek(Week),
}Expand description
A day field as a document writes it. Days with units (2w, 3d,
12h) read as Day::DaysFromStart.
Variants§
Implementations§
Source§impl Day
impl Day
Sourcepub fn resolve(
self,
cx: CalendarContext,
field: FieldOptions,
) -> Result<f64, CalendarError>
pub fn resolve( self, cx: CalendarContext, field: FieldOptions, ) -> Result<f64, CalendarError>
Days from the start date, read as field says: an inclusive date
or week covers its whole span, and a duration takes no date or
week.
§Errors
A date or week with no start date, a week with no week system or that its year does not have, or a date, week or negative value where a duration does not allow one.
Sourcepub fn from_days(days: f64, cx: CalendarContext, field: FieldOptions) -> Self
pub fn from_days(days: f64, cx: CalendarContext, field: FieldOptions) -> Self
With a start date and days a whole day in range, a week if field
asks for one and the day starts a week, else a date; days otherwise
and for a duration.
Trait Implementations§
impl Copy for Day
Source§impl<'de> Deserialize<'de> for Day
impl<'de> Deserialize<'de> for Day
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 PartialOrd for Day
Days compare with days, dates with dates and weeks with weeks; other
pairs are incomparable without a start date.
impl PartialOrd for Day
Days compare with days, dates with dates and weeks with weeks; other pairs are incomparable without a start date.
impl StructuralPartialEq for Day
Auto Trait Implementations§
impl Freeze for Day
impl RefUnwindSafe for Day
impl Send for Day
impl Sync for Day
impl Unpin for Day
impl UnsafeUnpin for Day
impl UnwindSafe for Day
Blanket Implementations§
§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
§type ArchivedMetadata = ()
type ArchivedMetadata = ()
The archived version of the pointer metadata for this type.
§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
Converts some archived metadata to the pointer metadata for itself.
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,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
§impl<T> LayoutRaw for T
impl<T> LayoutRaw for T
§fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
Returns the layout of the type.