Expand description
Transport layer abstraction for CLI communication.
This module defines the Transport trait, which abstracts the communication
channel between the SDK and the Claude Code CLI process. The default implementation
is SubprocessCliTransport, which spawns
the CLI as a child process and communicates via stdin/stdout.
Custom transports can be implemented for testing or alternative communication
mechanisms by implementing the Transport trait.
§Split I/O
For concurrent read/write scenarios, the transport can be split into independent
reader and writer halves via Transport::into_split(). Implementations can use
split_with_adapter() for a simple lock-based fallback via SplitAdapter.
Modules§
- subprocess_
cli - Subprocess-based transport for the Claude Code CLI.
Structs§
- Split
Adapter - Lock-based split adapter for backward-compatible transport splitting.
- Split
Adapter Reader - Reader half of a
SplitAdapter. - Split
Adapter Writer - Writer half of a
SplitAdapter.
Traits§
- Transport
- Async transport trait for bidirectional communication with the Claude Code CLI.
- Transport
Close Handle - Handle for closing a transport after it has been split.
- Transport
Factory - Factory for creating fresh
Transportinstances. - Transport
Reader - Async reader half of a split transport.
- Transport
Writer - Async writer half of a split transport.
Functions§
- split_
with_ adapter - Splits a transport using a lock-based adapter.
Type Aliases§
- Transport
Split Result - The result of splitting a transport into independent reader, writer, and close handle.