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

Provide opt-in variable length integer encoding #182

Closed
dtolnay opened this issue May 12, 2017 · 2 comments
Closed

Provide opt-in variable length integer encoding #182

dtolnay opened this issue May 12, 2017 · 2 comments

Comments

@dtolnay
Copy link
Collaborator

@dtolnay dtolnay commented May 12, 2017

Maybe something like:

#[derive(Serialize, Deserialize)]
struct Example {
    #[serde(with = "bincode::varint")]
    a: usize,
    #[serde(with = "bincode::varint")]
    b: i32,
}
@whimboo
Copy link

@whimboo whimboo commented Aug 29, 2019

To implement eg. the ADB protocol an encoded length of 4 bytes is used. @dtolnay, would that be possible to define via this issue request, or is it something else?

@Tolsi
Copy link

@Tolsi Tolsi commented Nov 5, 2019

PTAL

@ZoeyR ZoeyR closed this May 19, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
4 participants
You can’t perform that action at this time.