Skip to main content

TimeService

Struct TimeService 

Source
pub struct TimeService {
    pub default_tdf: TdfT,
    pub default_inaccuracy: InaccuracyT,
    pub secure_source: bool,
}
Expand description

TimeService-Object — Spec §2.1. ZeroDDS-Implementation als plain Rust-Struct (kein CORBA-Object).

Fields§

§default_tdf: TdfT

Tdf, der bei universal_time() in den UTOs gesetzt wird. Default 0 (Greenwich).

§default_inaccuracy: InaccuracyT

Inaccuracy, die bei universal_time() in den UTOs angegeben wird. Default 0 (Spec erlaubt Implementations, ihre eigene Inaccuracy zu kennen).

§secure_source: bool

Wenn true, dann ist die zugrundeliegende Zeitquelle als “secure” markiert (Spec §2.1.2 + Appendix A). Sonst wirft secure_universal_time() TimeUnavailable.

Implementations§

Source§

impl TimeService

Source

pub fn universal_time(&self) -> Result<Uto, TimeUnavailable>

Spec §2.1.1 — universal_time(). Liefert die aktuelle Zeit. Raises TimeUnavailable, wenn die Time-Source nicht verfuegbar ist.

§Errors

TimeUnavailable wenn current_time() 0 zurueckliefert (z.B. no_std ohne Real-Clock).

Source

pub fn secure_universal_time(&self) -> Result<Uto, TimeUnavailable>

Spec §2.1.2 — secure_universal_time(). Liefert Zeit nur, wenn die Time-Source als “secure” konfiguriert ist (Spec Appendix A).

§Errors

TimeUnavailable wenn secure_source = false oder die Time-Source nicht verfuegbar ist.

Source

pub fn new_universal_time( time: TimeT, inaccuracy: InaccuracyT, tdf: TdfT, ) -> Uto

Spec §2.1.2.1 — new_universal_time(time, inaccuracy, tdf).

§Errors

Spec sagt CORBA::BAD_PARAM bei out-of-range Inaccuracy. Wir kappen statt dessen still auf 48 bit (siehe UtcT::new).

Source

pub fn uto_from_utc(utc: UtcT) -> Uto

Spec §2.1.2.2 — uto_from_utc(utc).

Source

pub fn new_interval(lower: TimeT, upper: TimeT) -> Option<Tio>

Spec §2.1.2.3 — new_interval(lower, upper). Raises CORBA::BAD_PARAM wenn lower > upper. Wir liefern None.

Trait Implementations§

Source§

impl Clone for TimeService

Source§

fn clone(&self) -> TimeService

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Debug for TimeService

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for TimeService

Source§

fn default() -> TimeService

Returns the “default value” for a type. Read more
Source§

impl Copy for TimeService

Auto Trait Implementations§

Blanket Implementations§

Source§

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

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

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

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

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

Source§

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

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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 T
where 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 T
where T: Clone,

Source§

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 T
where U: Into<T>,

Source§

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 T
where U: TryFrom<T>,

Source§

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.