pub struct SpecificDate { /* private fields */ }Expand description
One real day of the Gregorian calendar within the years a BACnet Date can carry (1900 to 2154).
Ordering is chronological.
Implementations§
Source§impl SpecificDate
impl SpecificDate
Sourcepub fn new(year: u16, month: u8, day: u8) -> Option<Self>
pub fn new(year: u16, month: u8, day: u8) -> Option<Self>
The day year-month-day, or None when no such day exists or the
year is outside 1900 to 2154.
Sourcepub fn from_date(date: &Date) -> Option<Self>
pub fn from_date(date: &Date) -> Option<Self>
The day a Date names, or None unless its year, month and day are all
specified and name a real day (no special month or day values).
The weekday octet is ignored; weekday computes it.
Sourcepub fn days_in_month(self) -> u8
pub fn days_in_month(self) -> u8
The number of days in this day’s month.
Sourcepub fn weekday(self) -> u8
pub fn weekday(self) -> u8
The day of the week, 1 (Monday) to 7 (Sunday), as BACnet numbers it.
Sourcepub fn days_since_1970(self) -> i64
pub fn days_since_1970(self) -> i64
Days from 1970-01-01 to this day, negative before it: a day number that runs on across month and year ends.
Trait Implementations§
Source§impl Clone for SpecificDate
impl Clone for SpecificDate
impl Copy for SpecificDate
Source§impl Debug for SpecificDate
impl Debug for SpecificDate
impl Eq for SpecificDate
Source§impl Hash for SpecificDate
impl Hash for SpecificDate
Source§impl Ord for SpecificDate
impl Ord for SpecificDate
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 PartialEq for SpecificDate
impl PartialEq for SpecificDate
Source§impl PartialOrd for SpecificDate
impl PartialOrd for SpecificDate
impl StructuralPartialEq for SpecificDate
Auto Trait Implementations§
impl Freeze for SpecificDate
impl RefUnwindSafe for SpecificDate
impl Send for SpecificDate
impl Sync for SpecificDate
impl Unpin for SpecificDate
impl UnsafeUnpin for SpecificDate
impl UnwindSafe for SpecificDate
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