# Ana Hobden - Pretty State Machine Patterns in Rust (Highlights)

## Highlights
- So here we're actually building the state into the type signature of the `BottleFillingMachine` itself. A state machine in the 'Filling' state is `BottleFillingMachine<Filling>` which is just **awesome** since it means when we see it as part of an error message or something we know immediately what state the machine is in. ([View Highlight](https://read.readwise.io/read/01js8wa8htw0yqv103x1zznftx)) ^879703656
↩︎
```
struct BottleFillingMachine<S> {
shared_value: usize,
state: S
}
```
- So how can we have some parent structure hold our state machine without it being a gigantic pain to interact with? Well, this circles us back around to the `enum` idea we had at first. ([View Highlight](https://read.readwise.io/read/01js8wdv0w0etq1fhj6f9gjwz8)) ^879703785