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
//! `bcur` — a Rust implementation of [Uniform Resources](https://github.com/BlockchainCommons/Research/blob/master/papers/bcr-2020-005-ur.md).
//!
//! # Status
//!
//! **0.1** ships the transport stack: bytewords, fountain codes, multi-part UR,
//! and [`DecoderLimits`]. Typed dCBOR (`feature = "dcbor"`) is a stub until 0.2.
//!
//! # Features
//!
//! - **`std`** (default): host builds.
//! - **`dcbor`**: optional typed dCBOR layer (implies `std`; API from 0.2).
//! - **`bytemoji`**: optional bytemoji helpers (planned).
//!
//! Core transport always requires `alloc` and supports `no_std` via
//! `--no-default-features`.
//!
//! # Example
//!
//! ```
//! let data = b"Ten chars!".repeat(10);
//! let mut encoder = bcur::Encoder::bytes(&data, 5).unwrap();
//! let mut decoder = bcur::Decoder::default();
//! while !decoder.complete() {
//! let part = encoder.next_part().unwrap();
//! if encoder.current_index() & 1 > 0 {
//! decoder.receive(&part).unwrap();
//! }
//! }
//! assert_eq!(decoder.message().unwrap().as_deref(), Some(data.as_slice()));
//! ```
extern crate alloc;
pub use ;
pub use DecoderLimits;
pub use ;
// Dev-only tools are linked into test/bench targets; keep the lib lint clean.
use criterion as _;