-
-
Save jamesmunns/5bf6dbdcf4d8a5884fc0f5e74a13dbfb to your computer and use it in GitHub Desktop.
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
#[derive(Schema)] | |
enum Inner { | |
Alpha, | |
Beta, | |
Gamma, | |
Delta(i32, i16), | |
} | |
#[derive(Schema)] | |
struct Outer { | |
a: u32, | |
b: u64, | |
c: u8, | |
d: Inner, | |
e: [u8; 10], | |
} | |
const OUTER_HUMAN2: &str = "\ | |
Struct { # Outer | |
[ varint(u32) ], # Outer.a | |
[ varint(u64) ], # Outer.b | |
[ u8 ], # Outer.c | |
[ Enum: # Outer.d | |
| oneof: [ varint(0) ] # Inner::Alpha | |
| oneof: [ varint(1) ] # Inner::Beta | |
| oneof: [ varint(2) ] # Inner::Gamma | |
| oneof: [ varint(3) ][ varint(i32) ][ varint(i16) ] # Inner::Delta | |
], | |
[ u8 ][ u8 ][ u8 ][ u8 ][ u8 ][ u8 ][ u8 ][ u8 ][ u8 ][ u8 ] # Outer.e | |
} | |
"; | |
const INNER_HUMAN2: &str = "\ | |
Enum: # Inner | |
| oneof: [ varint(0) ] # Inner::Alpha | |
| oneof: [ varint(1) ] # Inner::Beta | |
| oneof: [ varint(2) ] # Inner::Gamma | |
| oneof: [ varint(3) ][ varint(i32) ][ varint(i16) ] # Inner::Delta | |
"; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment