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

Added methods to set and add bytes and str #70

Merged
merged 1 commit into from
Mar 26, 2024

Conversation

mjhouse
Copy link
Owner

@mjhouse mjhouse commented Mar 26, 2024

Should resolve #31

  • Simplified get to allow conversion into any type that implements TryFrom<&DataWord>. This allows us to use the method to get strings back from indexed words.
  • Added set_string and set_bytes to update the message body after construction.
  • Added add_string and add_bytes to append to the message body .
  • Added with_string and with_bytes to parse strings and bytes into words during construction.
  • Changed at to return a reference to be more in line with std
  • Added validation check for command words to insure that all data words have been given.
  • Added tests for all methods

@mjhouse mjhouse self-assigned this Mar 26, 2024
Copy link
Contributor

Coverage

File Coverage
All files 99%
src/message/packets.rs 100%
src/errors.rs 100%
src/word/words.rs 100%
src/fields.rs 100%
src/message/messages.rs 98%
src/word/enums.rs 100%
src/flags.rs 100%

Minimum allowed coverage is 95%

Generated by 🐒 cobertura-action against b333ed2

@mjhouse mjhouse merged commit 91784c0 into development Mar 26, 2024
17 checks passed
@mjhouse mjhouse deleted the add_setters_message branch March 26, 2024 13:21
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.

Add with_bytes / with_string method to messages
1 participant