Skip to content

feat: length_with_payload#28

Merged
mattsse merged 1 commit intomainfrom
prestwich/total-length
Oct 16, 2024
Merged

feat: length_with_payload#28
mattsse merged 1 commit intomainfrom
prestwich/total-length

Conversation

@prestwich
Copy link
Copy Markdown
Member

Adds a convenience function to Header to return the total length with the payload

Motivation

Seemed useful

Solution

PR Checklist

  • Added Tests
  • Added Documentation
  • Breaking changes
  • Updated CHANGELOG.md

Comment on lines +162 to +165
/// Returns the total length of the encoded header and payload.
pub const fn length_with_payload(&self) -> usize {
self.length() + self.payload_length
}
Copy link
Copy Markdown
Member

@mattsse mattsse Oct 16, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hmm, isn't this just length?

oh no length is the length of the header and length with payload is total length including payload

@mattsse mattsse merged commit fbc821d into main Oct 16, 2024
@mattsse mattsse deleted the prestwich/total-length branch October 16, 2024 20:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants