1#![warn(missing_docs)]
14
15pub mod board;
16pub mod commands;
17mod control;
18pub mod conversion;
19pub mod device;
20pub mod error;
21mod filters;
22mod iqconverter_float;
23mod iqconverter_int16;
24mod peripherals;
25pub mod reader;
26pub mod stream;
27#[cfg(feature = "smol")]
28pub mod stream_smol;
29#[cfg(feature = "tokio")]
30pub mod stream_tokio;
31#[cfg(test)]
32pub(crate) mod test_vectors;
33mod transfer;
34mod transport;
35
36pub use board::PartIdSerial;
37pub use conversion::Samples;
38pub use device::{Device, list_devices};
39pub use error::{Error, Result};
40
41#[derive(Debug, Clone, Copy, PartialEq, Eq)]
45pub struct LibVersion {
46 pub major: u32,
48 pub minor: u32,
50 pub revision: u32,
52}
53
54#[must_use]
56pub fn lib_version() -> LibVersion {
57 let parse = |s: &str| s.parse().unwrap_or(0);
58 LibVersion {
59 major: parse(env!("CARGO_PKG_VERSION_MAJOR")),
60 minor: parse(env!("CARGO_PKG_VERSION_MINOR")),
61 revision: parse(env!("CARGO_PKG_VERSION_PATCH")),
62 }
63}
64
65#[cfg(test)]
66mod tests {
67 use super::*;
68
69 #[test]
70 fn lib_version_matches_crate_version() {
71 let v = lib_version();
72 assert_eq!(
73 format!("{}.{}.{}", v.major, v.minor, v.revision),
74 env!("CARGO_PKG_VERSION")
75 );
76 }
77}