doc cfg support
Some checks failed
Rust/spacepackets/pipeline/head There was a failure building this commit
Some checks failed
Rust/spacepackets/pipeline/head There was a failure building this commit
This commit is contained in:
parent
a2673c9870
commit
65e85f20e0
@ -36,3 +36,7 @@ version = "1.0.1"
|
||||
default = ["std"]
|
||||
std = ["chrono/std", "chrono/clock", "alloc"]
|
||||
alloc = ["postcard/alloc"]
|
||||
|
||||
[package.metadata.docs.rs]
|
||||
all-features = true
|
||||
rustdoc-args = ["--cfg", "doc_cfg"]
|
||||
|
@ -158,7 +158,7 @@ macro_rules! sp_header_impls {
|
||||
pub(crate) use ccsds_impl;
|
||||
pub(crate) use sp_header_impls;
|
||||
|
||||
/// Generic trait for ECSS enumeration which consist of a PFC field denoting their length
|
||||
/// Generic trait for ECSS enumeration which consist of a PFC field denoting their bit length
|
||||
/// and an unsigned value. The trait makes no assumptions about the actual type of the unsigned
|
||||
/// value and only requires implementors to implement a function which writes the enumeration into
|
||||
/// a raw byte format.
|
||||
|
@ -65,6 +65,7 @@ pub struct SizeMissmatch {
|
||||
pub found: usize,
|
||||
pub expected: usize,
|
||||
}
|
||||
|
||||
#[derive(Debug, Copy, Clone, PartialEq, Eq)]
|
||||
pub enum ByteConversionError {
|
||||
/// The passed slice is too small. Returns the found and expected minimum size
|
||||
|
@ -370,6 +370,7 @@ impl<'slice> PusTc<'slice> {
|
||||
}
|
||||
|
||||
#[cfg(feature = "alloc")]
|
||||
#[cfg_attr(doc_cfg, doc(cfg(feature = "alloc")))]
|
||||
pub fn append_to_vec(&self, vec: &mut Vec<u8>) -> Result<usize, PusError> {
|
||||
let sph_zc = crate::zc::SpHeader::from(self.sp_header);
|
||||
let mut appended_len = PUS_TC_MIN_LEN_WITHOUT_APP_DATA;
|
||||
|
@ -47,6 +47,7 @@ pub enum TimestampError {
|
||||
}
|
||||
|
||||
#[cfg(feature = "std")]
|
||||
#[cfg_attr(doc_cfg, doc(cfg(feature = "std")))]
|
||||
pub fn seconds_since_epoch() -> f64 {
|
||||
SystemTime::now()
|
||||
.duration_since(SystemTime::UNIX_EPOCH)
|
||||
@ -133,6 +134,7 @@ impl CdsShortTimeProvider {
|
||||
}
|
||||
|
||||
#[cfg(feature = "std")]
|
||||
#[cfg_attr(doc_cfg, doc(cfg(feature = "std")))]
|
||||
pub fn from_now() -> Result<Self, SystemTimeError> {
|
||||
let now = SystemTime::now().duration_since(SystemTime::UNIX_EPOCH)?;
|
||||
let epoch = now.as_secs();
|
||||
@ -151,6 +153,7 @@ impl CdsShortTimeProvider {
|
||||
}
|
||||
|
||||
#[cfg(feature = "std")]
|
||||
#[cfg_attr(doc_cfg, doc(cfg(feature = "std")))]
|
||||
pub fn update_from_now(&mut self) -> Result<(), SystemTimeError> {
|
||||
let now = SystemTime::now().duration_since(SystemTime::UNIX_EPOCH)?;
|
||||
let epoch = now.as_secs();
|
||||
@ -168,6 +171,7 @@ impl CdsShortTimeProvider {
|
||||
}
|
||||
|
||||
#[cfg(feature = "std")]
|
||||
#[cfg_attr(doc_cfg, doc(cfg(feature = "std")))]
|
||||
pub fn ms_of_day_using_sysclock() -> u32 {
|
||||
Self::ms_of_day(seconds_since_epoch())
|
||||
}
|
||||
|
@ -352,6 +352,7 @@ impl<'slice> PusTm<'slice> {
|
||||
|
||||
/// Append the raw PUS byte representation to a provided [alloc::vec::Vec]
|
||||
#[cfg(feature = "alloc")]
|
||||
#[cfg_attr(doc_cfg, doc(cfg(feature = "alloc")))]
|
||||
pub fn append_to_vec(&self, vec: &mut Vec<u8>) -> Result<usize, PusError> {
|
||||
let sph_zc = crate::zc::SpHeader::from(self.sp_header);
|
||||
let mut appended_len =
|
||||
|
Loading…
Reference in New Issue
Block a user