Typestate
Currently, this crate exports a single macro: typestate!
.
The macro defines a small DSL to generate typestate-ready structures.
Syntax
The macro is defined by the following (pseudo) syntax:
(limited|strict)? $visibility? $struct_name
$(<$state_name $(:$state_trait_bound)?>)?
($($strict_mod_name::)? $strict_mod_trait)?
[$($typestate),+]
{$($struct_field:$struct_type),+}
Usage Examples
Example of unconstrained typestate:
typestate!;
Example of a limited typestate:
typestate!;
Example of a strict typestate:
typestate!;