pub struct ConversionMatrix;Expand description
Conversion matrix: documents and validates all allowed routes between the supported time scales.
§Example
use gnss_time::{ConversionMatrix, ScaleId};
// Check that GPS <-> Galileo is a fixed conversion
assert!(ScaleId::Gps.is_fixed(ScaleId::Galileo));
// Check that GPS <-> UTC requires leap seconds
assert!(ScaleId::Gps.needs_leap_seconds(ScaleId::Utc));
// Full 6x6 matrix
let matrix = ConversionMatrix::new();
assert_eq!(matrix.path_count(false), 14); // fixed paths
assert_eq!(matrix.path_count(true), 16); // contextual pathsImplementations§
Source§impl ConversionMatrix
impl ConversionMatrix
Sourcepub fn path_count(&self, contextual: bool) -> usize
pub fn path_count(&self, contextual: bool) -> usize
Returns the number of paths of the requested type (fixed or contextual).
Sourcepub fn kind(&self, from: ScaleId, to: ScaleId) -> ConversionKind
pub fn kind(&self, from: ScaleId, to: ScaleId) -> ConversionKind
Returns the conversion kind for from -> to.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ConversionMatrix
impl RefUnwindSafe for ConversionMatrix
impl Send for ConversionMatrix
impl Sync for ConversionMatrix
impl Unpin for ConversionMatrix
impl UnsafeUnpin for ConversionMatrix
impl UnwindSafe for ConversionMatrix
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more