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

Function collect_chunks

atomic-cli/src/service/mod.rs:514–524  ·  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

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