btpc_core/
lib.rs

1//! Core library for BTPC.
2// Spec: SEC-PATH-001
3
4mod error;
5mod limits;
6mod metadata;
7
8pub mod bencode;
9pub mod create;
10pub mod edit;
11pub mod magnet;
12pub mod metainfo;
13pub mod verify;
14
15pub use error::{Error, ErrorCategory, Result};
16pub use limits::{ParseLimits, ParseOptions};
17pub use metadata::{DhtNode, OptionalMetadata};
18pub use metainfo::{
19    Canonicality, InfoHashV1, InfoHashV2, Metainfo, TorrentBytes, TorrentFile, TorrentMode,
20    TorrentPath, UnknownField, ValidationReport, ValidationWarning,
21};
22
23/// Returns the BTPC core crate version.
24#[must_use]
25pub const fn version() -> &'static str {
26    env!("CARGO_PKG_VERSION")
27}
28
29#[cfg(test)]
30mod tests {
31    #[test]
32    fn version_matches_workspace_package() {
33        assert_eq!(super::version(), env!("CARGO_PKG_VERSION"));
34    }
35}