alloy_rlp/
lib.rs

1#![doc = include_str!("../README.md")]
2#![doc(
3    html_logo_url = "https://raw.githubusercontent.com/alloy-rs/core/main/assets/alloy.jpg",
4    html_favicon_url = "https://raw.githubusercontent.com/alloy-rs/core/main/assets/favicon.ico"
5)]
6#![warn(
7    missing_docs,
8    unreachable_pub,
9    unused_crate_dependencies,
10    clippy::missing_const_for_fn,
11    rustdoc::all
12)]
13#![deny(unused_must_use, rust_2018_idioms)]
14#![cfg_attr(not(feature = "std"), no_std)]
15#![cfg_attr(docsrs, feature(doc_cfg, doc_auto_cfg))]
16
17#[macro_use]
18#[allow(unused_imports)]
19extern crate alloc;
20
21mod decode;
22pub use decode::{decode_exact, Decodable, Rlp};
23
24mod error;
25pub use error::{Error, Result};
26
27mod encode;
28#[cfg(feature = "arrayvec")]
29pub use encode::encode_fixed_size;
30pub use encode::{
31    encode, encode_iter, encode_list, length_of_length, list_length, Encodable, MaxEncodedLen,
32    MaxEncodedLenAssoc,
33};
34
35mod header;
36pub use header::{Header, PayloadView};
37
38#[doc(no_inline)]
39pub use bytes::{self, Buf, BufMut, Bytes, BytesMut};
40
41#[cfg(feature = "derive")]
42#[doc(inline)]
43pub use alloy_rlp_derive::{
44    RlpDecodable, RlpDecodableWrapper, RlpEncodable, RlpEncodableWrapper, RlpMaxEncodedLen,
45};
46
47/// RLP prefix byte for 0-length string.
48pub const EMPTY_STRING_CODE: u8 = 0x80;
49
50/// RLP prefix byte for a 0-length array.
51pub const EMPTY_LIST_CODE: u8 = 0xC0;
52
53// Not public API.
54#[doc(hidden)]
55#[deprecated(since = "0.3.0", note = "use `Error` instead")]
56pub type DecodeError = Error;
57
58#[doc(hidden)]
59pub mod private {
60    pub use core::{
61        default::Default,
62        option::Option::{self, None, Some},
63        result::Result::{self, Err, Ok},
64    };
65}