pub struct Timestamp {
pub year: u16,
pub month: Option<u8>,
pub day: Option<u8>,
pub hour: Option<u8>,
pub minute: Option<u8>,
pub second: Option<u8>,
}Expand description
A subset of the ISO 8601 timestamp format
Fields§
§year: u16§month: Option<u8>§day: Option<u8>§hour: Option<u8>§minute: Option<u8>§second: Option<u8>Implementations§
Source§impl Timestamp
impl Timestamp
Sourcepub const MAX_LENGTH: usize = 19
pub const MAX_LENGTH: usize = 19
The maximum length of a timestamp in bytes
Sourcepub fn parse<R>(reader: &mut R, parse_mode: ParsingMode) -> Result<Option<Self>>where
R: Read,
pub fn parse<R>(reader: &mut R, parse_mode: ParsingMode) -> Result<Option<Self>>where
R: Read,
Read a Timestamp
NOTES:
- When not using
ParsingMode::Strict, this will skip any leading whitespace - Afterwards, this will take
Self::MAX_LENGTHbytes from the reader. Ensure that it only contains the timestamp
§Errors
- Failure to read from
reader - The timestamp is invalid
Trait Implementations§
Source§impl Ord for Timestamp
impl Ord for Timestamp
Source§impl PartialOrd for Timestamp
impl PartialOrd for Timestamp
impl Copy for Timestamp
impl Eq for Timestamp
impl StructuralPartialEq for Timestamp
Auto Trait Implementations§
impl Freeze for Timestamp
impl RefUnwindSafe for Timestamp
impl Send for Timestamp
impl Sync for Timestamp
impl Unpin for Timestamp
impl UnwindSafe for Timestamp
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