Skip to content

Commit

Permalink
feat: length_with_payload (#28)
Browse files Browse the repository at this point in the history
  • Loading branch information
prestwich authored Oct 16, 2024
1 parent 44606e8 commit fbc821d
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions crates/rlp/src/header.rs
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,11 @@ impl Header {
pub const fn length(&self) -> usize {
crate::length_of_length(self.payload_length)
}

/// Returns the total length of the encoded header and payload.
pub const fn length_with_payload(&self) -> usize {
self.length() + self.payload_length
}
}

/// Structured representation of an RLP payload.
Expand Down

0 comments on commit fbc821d

Please sign in to comment.