0.3.0
What's Changed
This release is focused on the Slice language and adds two long-planned enhancements:
-
Add support for discriminated unions or "enums with fields".
Enums with fields are mapped to record classes in C#, with helper methods generated by Dunet.Please refer to the updated enum documentation and the DiscriminatedUnion example.
-
Add new
Result<Success, Failure>
type to Slice.It's a new built-in generic type that behaves like an enum with 2 fields. In C#, it maps to a Dunet-enhanced generic record class.
The main use-case for
Result
is as an operation return type - it allows you to return a "successful completion" value or a custom error. This is an increasingly common pattern found in Rust and Swift that works very nicely for RPCs.See the new Result documentation and the CustomError example.
Full Changelog: v0.2.1...v0.3.0