alloy_primitives/bytes/rlp.rs
1use super::Bytes;
2use alloy_rlp::{Decodable, Encodable};
3
4impl Encodable for Bytes {
5 #[inline]
6 fn length(&self) -> usize {
7 self.0.length()
8 }
9
10 #[inline]
11 fn encode(&self, out: &mut dyn bytes::BufMut) {
12 self.0.encode(out);
13 }
14}
15
16impl Decodable for Bytes {
17 #[inline]
18 fn decode(buf: &mut &[u8]) -> Result<Self, alloy_rlp::Error> {
19 bytes::Bytes::decode(buf).map(Self)
20 }
21}