Cargo Features

[dependencies]
spacepackets = { version = "0.13.0", default-features = false, features = ["std", "alloc", "serde", "timelib", "defmt"] }
default = std

The std feature is set by default whenever spacepackets is added without default-features = false somewhere in the dependency tree.

std default = alloc

Enables clock and std of chrono and std of thiserror

thiserror:

Std feature enables support for formatting std::path::{Path, PathBuf}
conveniently in an error message.

#[derive(Error, Debug)]
#[error("failed to create configuration file {path}")]
pub struct MyError {
pub path: PathBuf,
pub source: std::io::Error,
}

Without std, this would need to be written #[error("... {}", path.display())].

Affects seq_count::stdmod, time::std_mod, time::seconds_since_epoch, time::ms_of_day_using_sysclock

alloc std

Enables alloc of optional chrono, optional defmt, and optional serde

serde:

Provide impls for types in the Rust core allocation and collections library including String, Box<T>, Vec<T>, and Cow<T>. This is a subset of std but may be enabled without depending on all of std.

Affects metadata::build_metadata_opts_from_vec, metadata::build_metadata_opts_from_owned_slice, pdu::WritablePduPacket.to_vec, tlv::WritableTlv.to_vec, tlv::alloc_mod, ecss::WritablePusPacket.to_vec, cds::DynCdsTimeProvider, cds::get_dyn_time_provider_from_bytes, time::TimeWriter.to_vec, util::UnsignedEnum.to_vec, ascii::alloc_mod_chrono

serde

Enables serde, serde of optional chrono

timelib

Enables time

Affects time::CcsdsTimeProvider.timelib_date_time

Features from optional dependencies

In crates that don't use the dep: syntax, optional dependencies automatically become Cargo features. These features may have been created by mistake, and this functionality may be removed in the future.

chrono std

Affects time::CcsdsTimeProvider.chrono_date_time, ascii::alloc_mod_chrono

defmt implicit feature