pub struct Date {
pub year: u8,
pub month: u8,
pub day: u8,
pub day_of_week: u8,
}Expand description
BACnet Date: year, month, day, day-of-week.
- Year: 0-254 relative to 1900 (0xFF = unspecified)
- Month: 1-14 (13=odd, 14=even, 0xFF=unspecified)
- Day: 1-34 (32=last, 33=odd, 34=even, 0xFF=unspecified)
- Day of week: 1=Monday..7=Sunday (0xFF=unspecified)
Fields§
§year: u8Year minus 1900 (0-254, or 0xFF for unspecified).
month: u8Month (1-14, or 0xFF for unspecified).
day: u8Day of month (1-34, or 0xFF for unspecified).
day_of_week: u8Day of week (1=Monday..7=Sunday, or 0xFF for unspecified).
Implementations§
Source§impl Date
impl Date
Sourcepub fn is_unspecified(&self) -> bool
pub fn is_unspecified(&self) -> bool
Whether every octet is unspecified, the date that matches any date.
Sourcepub fn is_valid_pattern(&self) -> bool
pub fn is_valid_pattern(&self) -> bool
Whether every octet holds a value Clause 20.2.12 defines for a date pattern: any year; month 1 to 14; day 1 to 34; weekday 1 to 7; each of them, or all, unspecified.
Sourcepub fn matches(&self, day: SpecificDate) -> bool
pub fn matches(&self, day: SpecificDate) -> bool
Whether this date, read as a pattern, matches day: each specified
octet must agree, including the odd, even and last-day values.
Source§impl Date
impl Date
Sourcepub const UNSPECIFIED: u8 = 0xFF
pub const UNSPECIFIED: u8 = 0xFF
Value indicating “unspecified” for any date field.
Sourcepub fn actual_year(&self) -> Option<u16>
pub fn actual_year(&self) -> Option<u16>
Get the actual year (1900 + year field), or None if unspecified.
Trait Implementations§
impl Copy for Date
impl Eq for Date
impl StructuralPartialEq for Date
Auto Trait Implementations§
impl Freeze for Date
impl RefUnwindSafe for Date
impl Send for Date
impl Sync for Date
impl Unpin for Date
impl UnsafeUnpin for Date
impl UnwindSafe for Date
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