pub struct ClientV2 { /* private fields */ }Expand description
v2 inference-socket client.
Construct via dial_tcp / dial_uds (Unix) / dial_pipe
(Windows). Wrap with crate::dial_and_wait_ready to retry
connect during daemon bring-up — the retry helper is generic over
the client type so the same wait logic serves v1 and v2.
Implementations§
Source§impl ClientV2
impl ClientV2
Sourcepub async fn dial_tcp(addr: &str) -> Result<Self, ClientError>
pub async fn dial_tcp(addr: &str) -> Result<Self, ClientError>
Open a TCP connection to addr (e.g. "127.0.0.1:47322").
v2 TCP transport is opt-in (config-flagged off by default);
see ADR 0015 §Endpoints for the configured port convention.
Sourcepub async fn dial_uds(path: &Path) -> Result<Self, ClientError>
pub async fn dial_uds(path: &Path) -> Result<Self, ClientError>
Open a Unix domain socket connection (Unix only). Default v2
path: ${XDG_RUNTIME_DIR}/inferd/infer.v2.sock on Linux,
${TMPDIR}/inferd/infer.v2.sock on macOS.
Sourcepub async fn generate(
&mut self,
req: RequestV2,
) -> Result<FrameStreamV2, ClientError>
pub async fn generate( &mut self, req: RequestV2, ) -> Result<FrameStreamV2, ClientError>
Send a RequestV2 and return a stream of ResponseV2 frames.
The stream completes after a terminal done or error frame
(or yields Err(ClientError::UnexpectedEof) if the daemon
closes the connection mid-stream).