zerodds-time-service 1.0.0-rc.1

OMG Time Service 1.1 (formal/2002-05-07) data types + UTO/TIO operations + TimeService API. Pure-Rust no_std + alloc.
Documentation
  • Coverage
  • 100%
    68 out of 68 items documented1 out of 40 items with examples
  • Size
  • Source code size: 45.69 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 1 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 9s Average build duration of successful builds.
  • all releases: 9s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • Homepage
  • zero-objects/zero-dds
    2 1 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • SandraK82

zerodds-time-service

License: Apache-2.0 Crates.io docs.rs

OMG Time Service 1.1 (formal/2002-05-07) — Datatypes + Operations + TimeService API.

Pure-Rust no_std + alloc, forbid(unsafe_code). Part of ZeroDDS. Safety classification: STANDARD.

Scope

Implementiert die normativen Datentypen und Operationen der OMG Time Service Spec 1.1 als Standalone-Library:

  • TimeBase (§1.3.2): TimeT, InaccuracyT, TdfT, UtcT (16-byte wire), IntervalT.
  • UTO (§1.3.4): Universal Time Object mit absolute_time, compare_time, time_to_interval, interval.
  • TIO (§1.3.5): Time Interval Object mit overlaps, contains, spans.
  • TimeService (§2.1): universal_time, secure_universal_time, new_universal_time, uto_from_utc, new_interval.

Out-of-Scope: CORBA-CosTimerEvent::TimerEventService (§2.2/§2.4) — verlangt CORBA-Event-Channel-ORB; wird im corba-ccm-CCM-PSM adressiert.

Verhältnis zu DDS-DCPS Time_t

OMG Time Service 1.1 und DDS-DCPS 1.4 §2.3.3 sind spec-distinkt:

Aspekt OMG Time Service 1.1 DDS-DCPS 1.4
Wire-Format UtcT 16 byte Time_t 8 byte
Epoch 15 October 1582 1 January 1970 (UNIX)
Auflösung 100ns Ticks 1ns (sec + nanosec)
Inaccuracy / TDF ja nein

ZeroDDS-DDS-DCPS verwendet ausschließlich das spec-mandate Time_t-Format. zerodds-time-service ist dafür NICHT der Backing-Layer — es ist eine eigene Public-API für Anwendungen, die OMG-Time-Service-1.1-Konformität brauchen (z.B. Distributed-Time-Sync mit Inaccuracy-Tracking).

Quick Start

use zerodds_time_service::{TimeService, Uto, ComparisonType};

let service = TimeService::default();
let now = service.universal_time().unwrap();

// Vergleich mit Inaccuracy-Envelope
let later = Uto::new(now.time() + 1_000_000, 50, 0);
let cmp = now.compare_time(ComparisonType::IntervalC, later);
assert_ne!(cmp, zerodds_time_service::TimeComparison::GreaterThan);

Feature-Flags

Feature Default Zweck
std std-Re-Exports + current_time() Wall-Clock; implies alloc
alloc mandatory (Vec/wire-buffer)

no_std-Build ohne std: current_time() liefert 0; eine echte Zeitquelle wird vom Embedding via TimeService::with_source(...) injiziert.

Tests

cargo test -p zerodds-time-service: 36 Tests (35 unit + 1 doctest).

Stability

Alle Public-API-Items sind ab 1.0.0-rc.1 semver-stabil.

Links