Skip to main content

Timedate

Struct Timedate 

Source
pub struct Timedate {
    pub innards0: u32,
    pub innards1: u32,
}
Expand description

8 raw bytes of a Notes TIMEDATE, exactly as they appear on disk. The two u32 “Innards” are stored little-endian.

Kept as opaque bytes rather than decoded fields so the value can serve double duty as an identifier (DBID, UNID-fragment, ReplicaID) and as a clock reading without re-parsing.

Fields§

§innards0: u32

Innards[0]. 1/100ths of a second since midnight UTC for clock uses; arbitrary bytes for identifier uses.

§innards1: u32

Innards[1]. High byte = timezone/DST flags; low 24 bits = Julian Day Number for clock uses.

Implementations§

Source§

impl Timedate

Source

pub fn from_bytes(bytes: &[u8]) -> Result<Self, NsfError>

Parse from an 8-byte slice. Returns an error if the slice is shorter than 8 bytes.

Source

pub fn as_clock(&self) -> Option<DecodedTimedate>

Treat the TIMEDATE as a clock reading and decode it. Returns None when the JDN is implausible (zero or far-future) which usually means the TIMEDATE is actually being used as an opaque identifier (DBID, ReplicaID).

Source

pub fn as_hex_id(&self) -> String

Render as an opaque 16-hex-character identifier. Used to display DBIDs and ReplicaIDs in the operator UI.

Order is the on-disk byte order (Innards[0] little-endian bytes first, then Innards[1] little-endian bytes). This matches what the Notes client shows in File / Database / Properties.

Trait Implementations§

Source§

impl Clone for Timedate

Source§

fn clone(&self) -> Timedate

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for Timedate

Source§

impl Debug for Timedate

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for Timedate

Source§

fn default() -> Timedate

Returns the “default value” for a type. Read more
Source§

impl Eq for Timedate

Source§

impl Hash for Timedate

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl PartialEq for Timedate

Source§

fn eq(&self, other: &Timedate) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl StructuralPartialEq for Timedate

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.