Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: length_with_payload #28

Merged
merged 1 commit into from
Oct 16, 2024
Merged

feat: length_with_payload #28

merged 1 commit into from
Oct 16, 2024

Conversation

prestwich
Copy link
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
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
18 checks passed
@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