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

Method next_chunk

crates/openshell-router/src/backend.rs:96–103  ·  view source on GitHub ↗

Read the next body chunk. Returns `None` when the body is exhausted.

(&mut self)

Source from the content-addressed store, hash-verified

94
95 /// Read the next body chunk. Returns `None` when the body is exhausted.
96 pub async fn next_chunk(&mut self) -> Result<Option<bytes::Bytes>, RouterError> {
97 match &mut self.body {
98 StreamingBody::Live(response) => response.chunk().await.map_err(|e| {
99 RouterError::UpstreamProtocol(format!("failed to read response chunk: {e}"))
100 }),
101 StreamingBody::Buffered(buf) => Ok(buf.take()),
102 }
103 }
104}
105
106fn sanitize_request_headers(

Calls

no outgoing calls