#[repr(C)]pub struct RtcTime {
pub tm_sec: c_int,
pub tm_min: c_int,
pub tm_hour: c_int,
pub tm_mday: c_int,
pub tm_mon: c_int,
pub tm_year: c_int,
pub tm_wday: c_int,
pub tm_yday: c_int,
pub tm_isdst: c_int,
}
Expand description
Linux struct rtc_time
wrapper
This structure is slightly shorter than other commonly used struct tm*
.
It is assumed that the Rtc is kept at UTC.
Note that the resolution of the time struct is only seconds.
Conversion from and to chrono::NaiveDateTime
is supported, any resolution
beyond seconds will silently be discarded without rounding.
Fields§
§tm_sec: c_int
Seconds
tm_min: c_int
Minutes
tm_hour: c_int
Hours
tm_mday: c_int
Day of the month (1-31)
tm_mon: c_int
Months since January (0-11)
tm_year: c_int
Years since YEAR_EPOCH
(1900)
tm_wday: c_int
unused, should be set to 0
tm_yday: c_int
unused, should be set to 0
tm_isdst: c_int
unused, should be set to 0
Trait Implementations§
Source§impl From<NaiveDateTime> for RtcTime
impl From<NaiveDateTime> for RtcTime
Source§fn from(ct: NaiveDateTime) -> RtcTime
fn from(ct: NaiveDateTime) -> RtcTime
Converts to this type from the input type.
Source§impl From<RtcTime> for NaiveDateTime
impl From<RtcTime> for NaiveDateTime
Source§fn from(rtc: RtcTime) -> NaiveDateTime
fn from(rtc: RtcTime) -> NaiveDateTime
Converts to this type from the input type.
impl Copy for RtcTime
impl Eq for RtcTime
impl StructuralPartialEq for RtcTime
Auto Trait Implementations§
impl Freeze for RtcTime
impl RefUnwindSafe for RtcTime
impl Send for RtcTime
impl Sync for RtcTime
impl Unpin for RtcTime
impl UnwindSafe for RtcTime
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