Struct dcf77_chrono::DCF77

source ·
pub struct DCF77 {
    pub date: DateTime<Utc>,
    pub antenna: bool,
    pub announce_daily_saving_time: bool,
    pub daily_saving_time: bool,
    pub standard_time: bool,
    pub bit_leap_second: bool,
}
Expand description

Struct that represents the DCF77 information

This struct contains a chrono DateTime<Utc> field and the metadata that the DCF77 offers.

Examples

use chrono::prelude::*;
use dcf77_chrono::DCF77;
let output = DCF77 {
   date: Utc.ymd(2021,
               11,
               12).and_hms(11,
                           22,
                           0),
   antenna: true,
   announce_daily_saving_time: false,
   daily_saving_time: false,
   standard_time: true,
   bit_leap_second: false};
   assert!(output.date.year() == 2021);
   assert!(output.date.month() == 11);
   assert!(output.date.day() == 12);
   assert!(output.antenna == true);
   assert!(output.announce_daily_saving_time == false);
   assert!(output.daily_saving_time == false);
   assert!(output.standard_time == true);
   assert!(output.bit_leap_second == false);

Fields§

§date: DateTime<Utc>

Date in UTC timezone

§antenna: bool

Antenna bit (always 0)

§announce_daily_saving_time: bool

Announce Bit for Daylight Saving Time (DST) Switching

§daily_saving_time: bool

If this bit is set, Daylight Saving Time (DST) is Active

§standard_time: bool

If this bit is set, Standard Time is Active

§bit_leap_second: bool

Announce Bit for Leap Second

Trait Implementations§

source§

impl Clone for DCF77

source§

fn clone(&self) -> DCF77

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Copy for DCF77

Auto Trait Implementations§

§

impl RefUnwindSafe for DCF77

§

impl Send for DCF77

§

impl Sync for DCF77

§

impl Unpin for DCF77

§

impl UnwindSafe for DCF77

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToOwned for Twhere T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

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

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.