Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upAllow struct members to be [de]serialised in a certain number of bits #58
Comments
|
This is practically impossible because bincode needs to work with rustc_serialize and serde; both of which are general enough that it would hard to get that information through them and back into the reader/writer in bincode. I suggest that you do something like this struct Entity {
xy: u8,
}
impl Entity {
fn x(&self) -> u8 {
self.xy & 0xF
}
fn y(&self) -> u8 {
self.xy & 0xF0
}
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
It is often necessary for binary protocols.
A la: