Module state

Module state 

Source
Expand description

Typestate connection management for MCP servers.

This module implements the typestate pattern for managing connection lifecycle, ensuring compile-time correctness of state transitions.

§Connection Lifecycle

Disconnected -> Connected -> Initializing -> Ready -> Closing

Each state transition is enforced at compile time through different types, preventing invalid state transitions.

Modules§

markers
Connection state markers.

Structs§

Connection
A typestate connection that tracks lifecycle state at the type level.
ConnectionData
Internal connection data shared across states.

Enums§

ConnectionEvent
Transition events for connection state changes.
ConnectionState
A state machine wrapper for connections that allows runtime state tracking.