doc corrections
All checks were successful
Rust/spacepackets/pipeline/pr-main This commit looks good
Rust/spacepackets/pipeline/head This commit looks good

This commit is contained in:
Robin Müller 2024-03-14 16:58:12 +01:00
parent 739b810ed3
commit fa450c3445
Signed by: muellerr
GPG Key ID: A649FB78196E3849
3 changed files with 11 additions and 10 deletions

View File

@ -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<i64>;
}
/// 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<DaysLen16Bits> {}
#[cfg_attr(doc_cfg, doc(cfg(feature = "alloc")))]
impl DynCdsTimeProvider for CdsTime<DaysLen24Bits> {}
/// 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<DaysLen24Bits> {
Self::from_now_generic(LengthOfDaySegment::Long24Bits)
}
/// Create a provider from a [`DateTime<Utc>`] struct.
/// Create a provider from a [`chrono::DateTime<chrono::Utc>`] struct.
///
/// ## Errors
///
@ -909,7 +909,7 @@ impl CdsTime<DaysLen16Bits> {
Self::generic_new(LengthOfDaySegment::Short16Bits, ccsds_days, ms_of_day).unwrap()
}
/// Create a provider from a [`DateTime<Utc>`] struct.
/// Create a provider from a [`chrono::DateTime<Utc>`] 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

View File

@ -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, CucError> {
Self::new_generic(WidthCounterPair(4, counter), Some(fractions))
}

View File

@ -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");