Handler for cloud metadata HTTP requests. Implementors receive the parsed HTTP method, path, raw request bytes, and a bidirectional stream to write the response. The handler owns the response format (status, headers, body) — the server only does TCP accept and HTTP request-line parsing.
| 30 | /// response format (status, headers, body) — the server only does TCP |
| 31 | /// accept and HTTP request-line parsing. |
| 32 | pub trait MetadataHandler: Send + Sync + 'static { |
| 33 | fn handle<S: AsyncRead + AsyncWrite + Unpin + Send>( |
| 34 | &self, |
| 35 | method: &str, |
| 36 | path: &str, |
| 37 | request: &[u8], |
| 38 | stream: &mut S, |
| 39 | ) -> impl Future<Output = Result<()>> + Send; |
| 40 | } |
| 41 | |
| 42 | /// Bind a TCP listener inside the sandbox network namespace. |
| 43 | /// |
nothing calls this directly
no outgoing calls
no test coverage detected