MCPcopy Create free account
hub / github.com/NVIDIA/OpenShell / connect

Method connect

crates/openshell-driver-podman/src/client.rs:277–295  ·  view source on GitHub ↗

Open a new HTTP/1.1 connection to the Podman socket.

(
        &self,
    )

Source from the content-addressed store, hash-verified

275
276 /// Open a new HTTP/1.1 connection to the Podman socket.
277 async fn connect(
278 &self,
279 ) -> Result<hyper::client::conn::http1::SendRequest<Full<Bytes>>, PodmanApiError> {
280 let stream = UnixStream::connect(&self.socket_path).await.map_err(|e| {
281 PodmanApiError::Connection(format!("{}: {e}", self.socket_path.display()))
282 })?;
283
284 let (sender, conn) = hyper::client::conn::http1::handshake(TokioIo::new(stream))
285 .await
286 .map_err(|e| PodmanApiError::Connection(e.to_string()))?;
287
288 tokio::spawn(async move {
289 if let Err(e) = conn.await {
290 debug!(error = %e, "Podman API connection closed");
291 }
292 });
293
294 Ok(sender)
295 }
296
297 // ── Request infrastructure ───────────────────────────────────────────
298

Callers 2

send_requestMethod · 0.45
events_streamMethod · 0.45

Calls 2

connectFunction · 0.85
spawnFunction · 0.50

Tested by

no test coverage detected