MCPcopy Index your code
hub / github.com/NVIDIA/OpenShell / MetadataHandler

Interface MetadataHandler

crates/openshell-sandbox/src/metadata_server.rs:32–40  ·  view source on GitHub ↗

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.

Source from the content-addressed store, hash-verified

30/// response format (status, headers, body) — the server only does TCP
31/// accept and HTTP request-line parsing.
32pub 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///

Callers

nothing calls this directly

Implementers 1

google_cloud_metadata.rscrates/openshell-sandbox/src/google_cl

Calls

no outgoing calls

Tested by

no test coverage detected