1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
//! A Rust library for encoding and decoding data in the Bencode format, commonly used in BitTorrent files.
//! This library provides functionality to parse, create, modify and serialize bencode data structures
//! with support for various formats including JSON, YAML and XML conversion.
//!
//! # Features
//!
//! - `std` (default): Enable standard library support
//! - Without `std`: Core bencode functionality works in `no_std` environments
extern crate alloc;
pub use BTreeMap as HashMap;
pub use HashMap;
/// Centralized bencode protocol character and byte constants
pub
/// Module defining custom error types and error handling functionality
/// Module providing input/output operations for reading and writing bencode data
/// Module containing utility functions and helper methods
/// Module containing configuration options for parsing and encoding
/// Module providing memory management utilities for embedded systems
/// Module defining the core data structures for representing bencode nodes
/// Module containing the parsing logic to decode bencode format into data structures
/// Module implementing serialization of data structures back to bencode format
/// Integration tests module
///
/// babbel_bencode API
///
/// Returns the current version of the bencode library
pub use get_version as version;
/// Reads and parses a bencode-encoded file from disc (requires `std` feature)
pub use read_bencode_file as read_file;
/// Writes bencode-encoded data to a file on disk (requires `std` feature)
pub use write_bencode_file as write_file;
/// Destination implementation for writing bencode data to a memory buffer
pub use Buffer as BufferDestination;
/// Destination implementation for writing bencode data to a file (requires `std` feature)
pub use File as FileDestination;
/// Source implementation for reading bencode data from a memory buffer
pub use Buffer as BufferSource;
/// Source implementation for reading bencode data from a file (requires `std` feature)
pub use File as FileSource;
/// Core data structure representing a bencode node in the parsed tree
pub use Node;
pub use make_node;
/// Zero-copy borrowed node for embedded systems (no allocation)
pub use BorrowedNode;
/// Type alias for fixed-size stack buffers with const generics
pub use FixedSizeBuffer;
/// Memory bounds calculator using const generics
pub use MemoryBounds;
/// Parses bencode data into a Node tree structure
pub use parse;
/// Parses bencode data from a byte slice into a Node tree structure
pub use parse_bytes;
/// Parses bencode data from a string into a Node tree structure
pub use parse_str;
/// Zero-copy parser that returns borrowed nodes (no allocation)
pub use parse_borrowed;
/// Validates bencode data without building a node tree (minimal allocation)
pub use validate_bencode;
/// Parses bencode data from a byte slice using iterative parser
pub use parse_bytes_iterative;
/// Iterative parser that avoids recursion (for deeply nested structures)
pub use parse_iterative;
/// Parses bencode data from a string using iterative parser
pub use parse_str_iterative;
/// Arena allocator for bump allocation from fixed buffers
pub use Arena;
/// Memory usage tracker for embedded systems
pub use MemoryTracker;
/// Stack-based fixed-size buffer
pub use StackBuffer;
/// Lightweight error type for embedded systems (no heap allocation)
pub use BencodeError;
/// Encoder configuration options
pub use EncoderConfig;
/// Parser configuration options
pub use ParserConfig;
/// Converts a Node tree back to bencode format
pub use stringify;
/// Converts a Node tree to bencode format as bytes
pub use stringify_to_bytes;
/// Converts a Node tree to bencode format as a String
pub use stringify_to_string;
/// Core SOLID I/O abstractions
pub use ;
/// Schema validation and typed dictionary query extension trait
pub use NodeQueryExt;
/// Visitor pattern traits for format serialization
pub use ;
/// Converts a Node tree to JSON format (requires "json" feature)
pub use stringify as to_json;
/// Converts a Node tree to TOML format (requires "toml" feature)
pub use stringify as to_toml;
/// Converts a Node tree to XML format (requires "xml" feature)
pub use stringify as to_xml;
/// Converts a Node tree to YAML format (requires "yaml" feature)
pub use stringify as to_yaml;