diff --git a/src/time/cds.rs b/src/time/cds.rs index e2ce4fb..3df4b11 100644 --- a/src/time/cds.rs +++ b/src/time/cds.rs @@ -1,7 +1,7 @@ //! Module to generate or read CCSDS Day Segmented (CDS) timestamps as specified in //! [CCSDS 301.0-B-4](https://public.ccsds.org/Pubs/301x0b4e1.pdf) section 3.3 . //! -//! The core data structure to do this is the [TimeProvider] struct and the +//! The core data structure to do this is the [CdsTime] struct and the //! [get_dyn_time_provider_from_bytes] function to retrieve correct instances of the //! struct from a bytestream. use crate::private::Sealed; @@ -58,7 +58,7 @@ pub trait ProvidesDaysLength: Sealed + Clone { + Into; } -/// Type level token to be used as a generic parameter to [TimeProvider]. +/// Type level token to be used as a generic parameter to [CdsTime]. #[derive(Debug, Copy, Clone, PartialEq, Eq, Default)] pub struct DaysLen16Bits {} @@ -67,7 +67,7 @@ impl ProvidesDaysLength for DaysLen16Bits { type FieldType = u16; } -/// Type level token to be used as a generic parameter to [TimeProvider]. +/// Type level token to be used as a generic parameter to [CdsTime]. #[derive(Debug, Copy, Clone, PartialEq, Eq, Default)] pub struct DaysLen24Bits {} impl Sealed for DaysLen24Bits {} @@ -443,7 +443,7 @@ impl DynCdsTimeProvider for CdsTime {} #[cfg_attr(doc_cfg, doc(cfg(feature = "alloc")))] impl DynCdsTimeProvider for CdsTime {} -/// This function returns the correct [TimeProvider] instance from a raw byte array +/// This function returns the correct [CdsTime] instance from a raw byte array /// by checking the length of days field. It also checks the CCSDS time code for correctness. /// /// # Example @@ -817,7 +817,7 @@ impl CdsTime { Self::from_now_generic(LengthOfDaySegment::Long24Bits) } - /// Create a provider from a [`DateTime`] struct. + /// Create a provider from a [`chrono::DateTime`] struct. /// /// ## Errors /// @@ -909,7 +909,7 @@ impl CdsTime { Self::generic_new(LengthOfDaySegment::Short16Bits, ccsds_days, ms_of_day).unwrap() } - /// Create a provider from a [`DateTime`] struct. + /// Create a provider from a [`chrono::DateTime`] struct. /// /// This function will return a [TimestampError::DateBeforeCcsdsEpoch] or a /// [TimestampError::Cds] if the time is before the CCSDS epoch (01-01-1958 00:00:00) or diff --git a/src/time/cuc.rs b/src/time/cuc.rs index 6aa6c27..7bf1c9c 100644 --- a/src/time/cuc.rs +++ b/src/time/cuc.rs @@ -1,7 +1,8 @@ //! Module to generate or read CCSDS Unsegmented (CUC) timestamps as specified in //! [CCSDS 301.0-B-4](https://public.ccsds.org/Pubs/301x0b4e1.pdf) section 3.2 . //! -//! The core data structure to do this is the [TimeProviderCcsdsEpoch] struct. +//! The core data structure to do this is the [CucTime] struct which provides a CUC time object +//! using the CCSDS Epoch. #[cfg(feature = "serde")] use serde::{Deserialize, Serialize}; @@ -235,7 +236,7 @@ impl CucTime { Self::new_generic(WidthCounterPair(4, counter), None).unwrap() } - /// Like [TimeProviderCcsdsEpoch::new] but allow to supply a fractional part as well. + /// Like [CucTime::new] but allow to supply a fractional part as well. pub fn new_with_fractions(counter: u32, fractions: FractionalPart) -> Result { Self::new_generic(WidthCounterPair(4, counter), Some(fractions)) } diff --git a/src/time/mod.rs b/src/time/mod.rs index d971885..9018e18 100644 --- a/src/time/mod.rs +++ b/src/time/mod.rs @@ -301,7 +301,7 @@ impl UnixTime { } /// This function will panic if the subsecond value is larger than the fraction of a second. - /// Use [new_checked] if you want to handle this case without a panic. + /// Use [Self::new_checked] if you want to handle this case without a panic. pub const fn new(unix_seconds: i64, subsecond_nanos: u32) -> Self { if subsecond_nanos >= NANOS_PER_SECOND { panic!("invalid subsecond nanos value"); @@ -313,7 +313,7 @@ impl UnixTime { } /// This function will panic if the subsecond value is larger than the fraction of a second. - /// Use [new_subsecond_millis_checked] if you want to handle this case without a panic. + /// Use [Self::new_subsec_millis_checked] if you want to handle this case without a panic. pub const fn new_subsec_millis(unix_seconds: i64, subsecond_millis: u16) -> Self { if subsecond_millis >= 1000 { panic!("invalid subsecond millisecond value");