pub struct Timestamp {
pub year: u16,
pub month: u8,
pub day: u8,
pub hour: u8,
pub minute: u8,
pub second: u8,
pub tz_quarters: i8,
}Expand description
TP-SCTS / TP-DT / absolute TP-VP (23.040 §9.2.3.11): local time plus the offset to UTC in signed quarter hours. Two-digit years map to 1970–2069.
Fields§
§year: u16§month: u8§day: u8§hour: u8§minute: u8§second: u8§tz_quarters: i8Implementations§
Source§impl Timestamp
impl Timestamp
Sourcepub fn decode(b: &[u8; 7]) -> Option<Self>
pub fn decode(b: &[u8; 7]) -> Option<Self>
Decode 7 swapped-BCD octets; None if any field is out of range.
Sourcepub fn encode(&self) -> Option<[u8; 7]>
pub fn encode(&self) -> Option<[u8; 7]>
Encode; None if the year is outside 1970–2069, the offset beyond ±79
quarters, or a field out of range.
pub fn offset_minutes(&self) -> i32
Trait Implementations§
impl Copy for Timestamp
Source§impl<'de> Deserialize<'de> for Timestamp
impl<'de> Deserialize<'de> for Timestamp
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for Timestamp
impl StructuralPartialEq for Timestamp
Auto Trait Implementations§
impl Forget for Timestamp
impl Freeze for Timestamp
impl RefUnwindSafe for Timestamp
impl Send for Timestamp
impl Sync for Timestamp
impl Unpin for Timestamp
impl UnsafeUnpin 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