Expand description
Handoff typestate for compile-time safety of handoff lifecycle.
Uses the typestate pattern to make invalid state transitions uncompilable.
§State Transition Diagram
create() → Initiated ──┬── accept() ──→ Accepted ── complete() → Completed
└── reject() ──→ Rejected (terminal)Modules§
- private 🔒
Structs§
- Handoff
- A handoff with compile-time state tracking.
- Handoff
Accepted - Handoff was accepted by the receiving agent.
- Handoff
Completed - Handoff has been completed (terminal).
- Handoff
Record - Internal data storage for a handoff, independent of typestate. This is what gets persisted to the database.
- Initiated
- Handoff has been initiated, waiting for acceptance.
- Rejected
- Handoff was rejected by the receiving agent (terminal).
- Stored
Handoff - A handoff as stored in the database (status-agnostic).
Enums§
- Handoff
State Error - Errors when transitioning handoff states.
- Handoff
Status - Status of a handoff operation.
- Loaded
Handoff - Enum representing all possible runtime states of a handoff. Use this when you need to handle handoffs loaded from the database.
Traits§
- Handoff
State - Marker trait for handoff states.