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

epee: make {read,write}_varint public, create write_{bytes,container} #185

Merged
merged 5 commits into from
Jun 22, 2024

Conversation

hinto-janai
Copy link
Contributor

@hinto-janai hinto-janai commented Jun 21, 2024

  • epee_encoding::varint::{read,write}_varint() is made public
  • The duplicated inner implementations of some EpeeValue objects are extracted into epee_encoding::write_{bytes,iterator} and made public and generic

For example, a custom EpeeValue implementor can now do:

impl EpeeValue for CustomStr {
    /* ... */

    fn write<B: BufMut>(self, w: &mut B) -> Result<()> {
        epee_encoding::write_bytes(self, w)
    }
}

@github-actions github-actions bot added the A-net Related to networking. label Jun 21, 2024
@hinto-janai hinto-janai marked this pull request as ready for review June 21, 2024 19:25
@hinto-janai hinto-janai requested a review from Boog900 June 21, 2024 19:28
net/epee-encoding/src/lib.rs Outdated Show resolved Hide resolved
net/epee-encoding/src/lib.rs Show resolved Hide resolved
@hinto-janai hinto-janai requested a review from Boog900 June 22, 2024 00:03
@Boog900 Boog900 merged commit ff1172f into Cuprate:main Jun 22, 2024
6 checks passed
@hinto-janai hinto-janai deleted the epee branch June 22, 2024 01:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-net Related to networking.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants