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
//! `rustbinary` compact binary facade.
//!
//! The binary profile is not a separate codec — it is the same
//! `NsonSerialize` / `NsonDeserialize` implementations selected by the
//! codec's `is_human_readable() == false`. These helpers just shorten the
//! call path to `rustbinary`'s bounded, self-describing wire format.
//!
//! ```
//! # use tzcraft::{Date, Ticks};
//! let date = Date::from_ymd(2024, 6, 15).unwrap();
//! let bytes = tzcraft::binary::encode(&date).unwrap();
//! let back: Date = tzcraft::binary::decode(&bytes).unwrap();
//! assert_eq!(date, back);
//! ```
//!
//! Untrusted input should be decoded through a tuned [`Config`] (see
//! [`options`]) with explicit size limits, exactly as with any other
//! `rustbinary` consumer.
use Vec;
pub use ;
use ;
/// Encode a value into a `Vec<u8>` with the standard compact profile.
Sized>
/// Decode a value from a byte slice with the standard compact profile.
///
/// Borrowed targets may point into `input`.
/// Encode into a caller-owned slice without codec-owned allocation.
///
/// Returns the number of bytes written.
Sized>
/// Exact serialized byte count without allocating output.
Sized>