Last active
August 29, 2015 14:13
-
-
Save fbstj/6f74e37f51b1204854a3 to your computer and use it in GitHub Desktop.
Rust things
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
enum ID { | |
Standard(u16), | |
Extended(u32) | |
} | |
enum Payload { | |
Value { | |
length : u8, | |
data: [u8; 8] | |
}, | |
Remote(u8) | |
} | |
struct Frame { | |
id: ID, | |
payload: Payload | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
it'd be great if there were a way of saying "value is between 0 and 8 bytes of data" and "Standard is 11 bits long, Extended is 29 bits long"