mirror of
https://github.com/paradigmxyz/reth.git
synced 2026-02-16 09:56:17 -05:00
docs: add some encode docs (#1797)
This commit is contained in:
@@ -70,7 +70,12 @@ macro_rules! impl_max_encoded_len {
|
||||
#[auto_impl(&)]
|
||||
#[cfg_attr(feature = "alloc", auto_impl(Box, Arc))]
|
||||
pub trait Encodable {
|
||||
/// Appends the rlp encoded object to the specified output buffer.
|
||||
fn encode(&self, out: &mut dyn BufMut);
|
||||
|
||||
/// Returns the length of the encoded object.
|
||||
///
|
||||
/// NOTE: This includes the length of the rlp [Header].
|
||||
fn length(&self) -> usize {
|
||||
let mut out = BytesMut::new();
|
||||
self.encode(&mut out);
|
||||
|
||||
Reference in New Issue
Block a user