[−][src]Struct stm32l0xx_hal::rtc::Instant
An instant in time
You can create an instance of this struct using Instant::new
or
RTC::now
.
Methods
impl Instant
[src]
pub fn new() -> Self
[src]
Creates a new Instant
Initializes all fields with a default state, with year
/month
/day
being 1
and hour
/minute
/second
being 0
. You can use the
various set_*
methods to change the fields.
Please note that all set_*
methods validate their input, and will
panic, if you pass an invalid value.
Please also note, that the overall date is not validated, so it's
possible to create an Instant
set to February 31, for example.
pub fn set_year(self, year: u8) -> Self
[src]
pub fn set_month(self, month: u8) -> Self
[src]
pub fn set_day(self, day: u8) -> Self
[src]
pub fn set_hour(self, hour: u8) -> Self
[src]
pub fn set_minute(self, minute: u8) -> Self
[src]
pub fn set_second(self, second: u8) -> Self
[src]
pub fn year(&self) -> u8
[src]
pub fn month(&self) -> u8
[src]
pub fn day(&self) -> u8
[src]
pub fn hour(&self) -> u8
[src]
pub fn minute(&self) -> u8
[src]
pub fn second(&self) -> u8
[src]
Trait Implementations
impl Debug for Instant
[src]
impl Copy for Instant
[src]
impl Clone for Instant
[src]
fn clone(&self) -> Instant
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Auto Trait Implementations
Blanket Implementations
impl<T> From<T> for T
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = !
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Same<T> for T
type Output = T
Should always be Self