[][src]Struct stm32l0xx_hal::rtc::Instant

pub struct Instant { /* fields omitted */ }

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]

Change the year

Panics

Panics, if year is larger than 99.

pub fn set_month(self, month: u8) -> Self[src]

Change the month

Panics

Panics, if month is not a value from 1 to 12.

pub fn set_day(self, day: u8) -> Self[src]

Change the day

Panics

Panics, if day is not a value from 1 to 31.

pub fn set_hour(self, hour: u8) -> Self[src]

Change the hour

Panics

Panics, if hour is larger than 23.

pub fn set_minute(self, minute: u8) -> Self[src]

Change the minute

Panics

Panics, if minute larger than 59.

pub fn set_second(self, second: u8) -> Self[src]

Change the second

Panics

Panics, if second is larger than 59.

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]

Auto Trait Implementations

impl Unpin for Instant

impl Send for Instant

impl Sync for Instant

Blanket Implementations

impl<T> From<T> for T[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = !

The type returned in the event of a conversion error.

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self