Skip to main content

tempest_core/
lib.rs

1use bincode::Options as BincodeOptions;
2
3#[macro_use]
4extern crate tracing;
5
6#[macro_use]
7extern crate derive_more;
8
9pub mod encoding;
10pub mod journal;
11pub mod tempest_str;
12pub mod utils;
13
14#[cfg(any(test, feature = "testing"))]
15pub mod test_utils;
16
17/// The project wide used [`bincode`] encoding options.
18// WARN: NEVER CHANGE THIS, OR ALL OF FILE DECODING WILL BREAK!
19#[doc(hidden)]
20pub fn bincode_options() -> impl BincodeOptions {
21    bincode::options()
22        // TODO: should we enfore this, or switch to varint encoding?
23        .with_fixint_encoding() // no variable length ints, to ensure lower risk of errors
24        .with_little_endian() // ensure consistency across platforms, enforcing little endian
25        .allow_trailing_bytes() // important for decoding just parts of files, like in journals
26}