pub enum HostPipeError {
HostNotConnected,
WriteFailed(Error),
Serialize(Error),
BufferOverflow,
StaleSession,
}Expand description
Reasons send_command / send_event can fail synchronously.
HostNotConnected is reserved for cases where the caller wants to
fail-fast instead of buffering (CPD-3 will choose whichever
fits per command kind). The default send_command code path
buffers; see try_send_command_no_buffer for the fail-fast variant.
Variants§
HostNotConnected
No host is currently connected and the caller asked to fail rather than buffer.
WriteFailed(Error)
Underlying write to the pipe failed.
Serialize(Error)
Frame failed to serialize. Should be impossible for well- formed Command / Event variants but kept as a result variant for defense-in-depth.
BufferOverflow
Pending buffer is full and we couldn’t drop the oldest entry
to make room (e.g. caller asked for no-overflow semantics).
Default send_command does drop-oldest + emit-failed, so
callers won’t see this from the public API today.
StaleSession
Caller’s captured host_session_id no longer matches the
pipe’s current session (a new host registered, displacing the
old one). The caller — typically a per-host fanout task — should
exit immediately so it doesn’t write into the new host’s writer.
(codex P1 PR #642 round 2.)