Skip to main content

slice_codec/
lib.rs

1// Copyright (c) ZeroC, Inc.
2
3//! TODO write a doc comment explaining this crate.
4
5#![no_std]
6
7// If the 'alloc' feature is set, pull in [`alloc`](https://doc.rust-lang.org/alloc) as an external crate.
8#[cfg(feature = "alloc")]
9extern crate alloc;
10
11// If the 'std' feature is set, pull in [`std`](https://doc.rust-lang.org/std) as an external crate.
12// Even with this feature, parts of the [`prelude`](https://doc.rust-lang.org/std/prelude) are still disabled,
13// so we need to fully qualify (or explicitly `use`) some types that would normally be pulled in automatically.
14#[cfg(feature = "std")]
15extern crate std;
16
17// These modules are private because they don't export any types, just implementations.
18mod decoding;
19mod encoding;
20
21pub mod buffer;
22pub mod decode_from;
23pub mod decoder;
24pub mod encode_into;
25pub mod encoder;
26
27// Re-export the contents of the `error` module directly into the crate root, so they're easier to reference.
28mod error;
29pub use error::*;
30
31/// The smallest value that can be represented as a `varint32`.
32pub const VARINT32_MIN: i32 = i32::MIN;
33/// The largest value that can be represented as a `varint32`.
34pub const VARINT32_MAX: i32 = i32::MAX;
35/// The smallest value that can be represented as a `varuint32`.
36pub const VARUINT32_MIN: u32 = u32::MIN;
37/// The largest value that can be represented as a `varuint32`.
38pub const VARUINT32_MAX: u32 = u32::MAX;
39/// The smallest value that can be represented as a `varint62`.
40pub const VARINT62_MIN: i64 = i64::MIN >> 2;
41/// The largest value that can be represented as a `varint62`.
42pub const VARINT62_MAX: i64 = i64::MAX >> 2;
43/// The smallest value that can be represented as a `varuint62`.
44pub const VARUINT62_MIN: u64 = u64::MIN >> 2;
45/// The largest value that can be represented as a `varuint62`.
46pub const VARUINT62_MAX: u64 = u64::MAX >> 2;