Detailed types
📄️ Vec, array, slice
Vec, Vec, ...
📄️ Structs
Normal Rust structs are supported. You can even use recursive fields, such as pub struct TreeNode { pub value Vec, pub parent: Box }.
📄️ Enums
Rust's enum are known to be very expressive and powerful - it allows each enum variant to have different associated data. Dart does not have such things in built-in enums, but no worries - we will automatically translate it into the equivalent using the freezed Dart library. The syntax for freezed may look a bit strange at the first glance, but please look at its doc and see its powerfulness.
📄️ Tuples
Introduced in Dart 3, records provide the equivalent of Rust's tuples.
📄️ Options
Dart has special syntaxs for nullable variables - the ? symbol, and we translate Option into ? automatically. You may refer to the official doc for more information.
📄️ Type alias
Type alias is also supported. For example:
📄️ Map and Set
The HashMap as well as HashSet are supported as well.
📄️ DateTime (Chrono)
Codegen optionally support chrono crate with feature chrono.
📄️ UUID
Codegen optionally support uuid crate with feature uuid.
📄️ Primitives
Types like i8, u8, i16, u16, i32, u32, i64, u64, isize, usize, i128, u128