pub struct Civil {
pub year: i32,
pub month: u8,
pub day: u8,
pub hour: u8,
pub minute: u8,
pub second: u8,
pub nanos: u32,
}Expand description
Calendar reading.
Public fields so a parser can fill it and pass it to
Instant::from_civil, which validates. A Civil from Instant::civil
is always valid.
Fields§
§year: i32Proleptic Gregorian year; 0 is 1 BC.
month: u8Month, 1..=12.
day: u8Day, 1..=31 as the month allows.
hour: u8Hour, 0..=23.
minute: u8Minute, 0..=59.
second: u8Second, 0..=59.
nanos: u32Nanoseconds, 0..1_000_000_000.
Implementations§
Trait Implementations§
impl Copy for Civil
impl Eq for Civil
Source§impl Ord for Civil
impl Ord for Civil
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 Civil
impl PartialOrd for Civil
impl StructuralPartialEq for Civil
Auto Trait Implementations§
impl Freeze for Civil
impl RefUnwindSafe for Civil
impl Send for Civil
impl Sync for Civil
impl Unpin for Civil
impl UnsafeUnpin for Civil
impl UnwindSafe for Civil
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