MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / collect_chunks

Function collect_chunks

atomic-cli/src/service/mod.rs:512–522  ·  view source on GitHub ↗
(
    mut stream: std::pin::Pin<
        Box<dyn futures_core::Stream<Item = Result<pb::DiffChunk, Status>> + Send>,
    >,
)

Source from the content-addressed store, hash-verified

510/// would fork the error surface.
511#[allow(clippy::result_large_err)]
512async fn collect_chunks(
513 mut stream: std::pin::Pin<
514 Box<dyn futures_core::Stream<Item = Result<pb::DiffChunk, Status>> + Send>,
515 >,
516) -> Result<Vec<pb::DiffChunk>, Status> {
517 let mut chunks = Vec::new();
518 while let Some(chunk) = tokio_stream::StreamExt::next(&mut stream).await {
519 chunks.push(chunk?);
520 }
521 Ok(chunks)
522}
523
524/// Collect a reactor client's tonic streaming response (same `Status`
525/// error surface as every reactor call).

Callers 2

diff_working_copyMethod · 0.85
diffMethod · 0.85

Calls 1

pushMethod · 0.45

Tested by

no test coverage detected