Open a new HTTP/1.1 connection to the Podman socket.
(
&self,
)
| 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 |
no test coverage detected