# `MingaEditor.Shell.StateStash`
[🔗](https://github.com/jsmestad/minga/blob/main/lib/minga_editor/shell/state_stash.ex#L1)

Stashed shell state tied to the exact shell registry identity that produced it.

Shell state is only safe to restore into the same registered shell module and source. Extension shell ids can be unregistered and later reused, so the registry generation is part of the identity as well.

# `t`

```elixir
@type t() :: %MingaEditor.Shell.StateStash{
  generation: non_neg_integer(),
  module: module(),
  source: MingaEditor.Shell.Entry.source(),
  state: MingaEditor.Shell.shell_state()
}
```

# `matches?`

```elixir
@spec matches?(t(), MingaEditor.Shell.Entry.t()) :: boolean()
```

Returns true when the stash belongs to the current registry entry.

# `new`

```elixir
@spec new(MingaEditor.Shell.Entry.t(), MingaEditor.Shell.shell_state()) :: t()
```

Stores shell state with the registry identity that produced it.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
