pub struct Quarter { /* private fields */ }Expand description
One quarter-hour of a business day, identified by its UTC start instant. Serialise-only: a quarter is constructed from the calendar, never deserialised into an inconsistent state.
Implementations§
Source§impl Quarter
impl Quarter
Sourcepub fn containing(instant: OffsetDateTime) -> Result<Self, CalendarError>
pub fn containing(instant: OffsetDateTime) -> Result<Self, CalendarError>
The quarter whose half-open interval contains instant.
§Errors
CalendarError::Unsupported outside the supported years.
Sourcepub fn starting_at(start: OffsetDateTime) -> Result<Self, CalendarError>
pub fn starting_at(start: OffsetDateTime) -> Result<Self, CalendarError>
The quarter starting exactly at start.
§Errors
CalendarError::Misaligned if start is not on a quarter boundary.
Sourcepub const fn start(&self) -> OffsetDateTime
pub const fn start(&self) -> OffsetDateTime
Start instant (UTC), inclusive.
Sourcepub fn end(&self) -> OffsetDateTime
pub fn end(&self) -> OffsetDateTime
End instant (UTC), exclusive.
Sourcepub fn next(&self) -> Result<Self, CalendarError>
pub fn next(&self) -> Result<Self, CalendarError>
The next quarter, crossing into the next business day when needed.
§Errors
CalendarError::Unsupported past the supported years.
Trait Implementations§
impl Copy for Quarter
impl Eq for Quarter
Source§impl Ord for Quarter
impl Ord for Quarter
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 PartialOrd for Quarter
impl PartialOrd for Quarter
impl StructuralPartialEq for Quarter
Auto Trait Implementations§
impl Forget for Quarter
impl Freeze for Quarter
impl Move for Quarter
impl RefUnwindSafe for Quarter
impl Send for Quarter
impl Sync for Quarter
impl Unpin for Quarter
impl UnsafeUnpin for Quarterwhere
NonZeroI32Inner: UnsafeUnpin,
impl UnwindSafe for Quarter
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