More granular error handling #73
@ -830,9 +830,9 @@ impl CdsTime<DaysLen24Bits> {
|
|||||||
///
|
///
|
||||||
/// ## Errors
|
/// ## Errors
|
||||||
///
|
///
|
||||||
/// This function will return [TimestampError::DateBeforeCcsdsEpoch] or
|
/// This function will return [CdsError::DateBeforeCcsdsEpoch] if the time is before the CCSDS
|
||||||
/// [TimestampError::Cds] if the time is before the CCSDS epoch (1958-01-01T00:00:00+00:00)
|
/// epoch (1958-01-01T00:00:00+00:00) or the CCSDS days value exceeds the allowed bit width
|
||||||
/// or the CCSDS days value exceeds the allowed bit width (24 bits).
|
/// (24 bits).
|
||||||
#[cfg(feature = "chrono")]
|
#[cfg(feature = "chrono")]
|
||||||
pub fn from_dt_with_u24_days(dt: &chrono::DateTime<chrono::Utc>) -> Result<Self, CdsError> {
|
pub fn from_dt_with_u24_days(dt: &chrono::DateTime<chrono::Utc>) -> Result<Self, CdsError> {
|
||||||
Self::from_dt_generic(dt, LengthOfDaySegment::Long24Bits)
|
Self::from_dt_generic(dt, LengthOfDaySegment::Long24Bits)
|
||||||
@ -842,9 +842,9 @@ impl CdsTime<DaysLen24Bits> {
|
|||||||
///
|
///
|
||||||
/// ## Errors
|
/// ## Errors
|
||||||
///
|
///
|
||||||
/// This function will return [TimestampError::DateBeforeCcsdsEpoch] or
|
/// This function will return [CdsError::DateBeforeCcsdsEpoch] if the time is before the CCSDS
|
||||||
/// [TimestampError::Cds] if the time is before the CCSDS epoch (1958-01-01T00:00:00+00:00)
|
/// epoch (1958-01-01T00:00:00+00:00) or the CCSDS days value exceeds the allowed bit width
|
||||||
/// or the CCSDS days value exceeds the allowed bit width (24 bits).
|
/// (24 bits).
|
||||||
pub fn from_unix_stamp_with_u24_days(
|
pub fn from_unix_stamp_with_u24_days(
|
||||||
unix_stamp: &UnixTime,
|
unix_stamp: &UnixTime,
|
||||||
submillis_prec: SubmillisPrecision,
|
submillis_prec: SubmillisPrecision,
|
||||||
@ -916,9 +916,9 @@ impl CdsTime<DaysLen16Bits> {
|
|||||||
|
|
||||||
/// Create a provider from a [`chrono::DateTime<Utc>`] struct.
|
/// Create a provider from a [`chrono::DateTime<Utc>`] struct.
|
||||||
///
|
///
|
||||||
/// This function will return a [TimestampError::DateBeforeCcsdsEpoch] or a
|
/// This function will return a [CdsError::DateBeforeCcsdsEpoch] if the time is before the
|
||||||
/// [TimestampError::Cds] if the time is before the CCSDS epoch (01-01-1958 00:00:00) or
|
/// CCSDS epoch (01-01-1958 00:00:00) or the CCSDS days value exceeds the allowed bit width
|
||||||
/// the CCSDS days value exceeds the allowed bit width (16 bits).
|
/// (16 bits).
|
||||||
#[cfg(feature = "chrono")]
|
#[cfg(feature = "chrono")]
|
||||||
pub fn from_dt_with_u16_days(dt: &chrono::DateTime<chrono::Utc>) -> Result<Self, CdsError> {
|
pub fn from_dt_with_u16_days(dt: &chrono::DateTime<chrono::Utc>) -> Result<Self, CdsError> {
|
||||||
Self::from_dt_generic(dt, LengthOfDaySegment::Short16Bits)
|
Self::from_dt_generic(dt, LengthOfDaySegment::Short16Bits)
|
||||||
@ -934,9 +934,9 @@ impl CdsTime<DaysLen16Bits> {
|
|||||||
///
|
///
|
||||||
/// ## Errors
|
/// ## Errors
|
||||||
///
|
///
|
||||||
/// This function will return [TimestampError::DateBeforeCcsdsEpoch] or
|
/// This function will return [CdsError::DateBeforeCcsdsEpoch] if the time is before the CCSDS
|
||||||
/// [TimestampError::Cds] if the time is before the CCSDS epoch (1958-01-01T00:00:00+00:00)
|
/// epoch (1958-01-01T00:00:00+00:00) or the CCSDS days value exceeds the allowed bit width
|
||||||
/// or the CCSDS days value exceeds the allowed bit width (24 bits).
|
/// (24 bits).
|
||||||
pub fn from_unix_stamp_with_u16_days(
|
pub fn from_unix_stamp_with_u16_days(
|
||||||
unix_stamp: &UnixTime,
|
unix_stamp: &UnixTime,
|
||||||
submillis_prec: SubmillisPrecision,
|
submillis_prec: SubmillisPrecision,
|
||||||
|
Loading…
Reference in New Issue
Block a user