diff --git a/README.md b/README.md index ed62511..77d0dd7 100644 --- a/README.md +++ b/README.md @@ -25,3 +25,41 @@ if err != nil { } // fmt.Print(buf.Bytes()) ``` + +### Optional Types + +```golang +type Person struct { + Name string + Age uint8 `bin:"optional"` +} +``` + +Rust equivalent: +```rust +struct Person { + name: String, + age: Option +} +``` + +### Enum Types + +```golang +type MyEnum struct { + Enum bin.BorshEnum `borsh_enum:"true"` + One bin.EmptyVariant + Two uint32 + Three int16 +} +``` + +Rust equivalent: +```rust +enum MyEnum { + One, + Two(u32), + Three(i16), +} +``` +