# 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:
```
($($strict_mod_name::)? $strict_mod_trait)?
[$($typestate),+]
{$($struct_field:$struct_type),+}
```
## Usage Examples
Example of unconstrained typestate:
```rust
typestate!(
Drone [Idle, Hovering, Flying] {
x: f32,
y: f32
}
);
```
Example of a limited typestate:
```rust
typestate!(
limited Drone [Idle, Hovering, Flying] {
x: f32,
y: f32
}
);
```
Example of a strict typestate:
```rust
typestate!(
strict Drone [Idle, Hovering, Flying] {
x: f32,
y: f32
}
);
```