Skip to content

Commit fbc821d

Browse files
authored
feat: length_with_payload (#28)
1 parent 44606e8 commit fbc821d

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

crates/rlp/src/header.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,11 @@ impl Header {
158158
pub const fn length(&self) -> usize {
159159
crate::length_of_length(self.payload_length)
160160
}
161+
162+
/// Returns the total length of the encoded header and payload.
163+
pub const fn length_with_payload(&self) -> usize {
164+
self.length() + self.payload_length
165+
}
161166
}
162167

163168
/// Structured representation of an RLP payload.

0 commit comments

Comments
 (0)