MCPcopy Create free account
hub / github.com/Botloader/botloader / read

Method read

components/runtime/src/extensions/httpclient.rs:184–197  ·  view source on GitHub ↗
(self: Rc<Self>, limit: usize)

Source from the content-addressed store, hash-verified

182 }
183
184 fn read(self: Rc<Self>, limit: usize) -> AsyncResult<BufView> {
185 Box::pin(async move {
186 let mut reader = RcRef::map(&self, |r| &r.body).borrow_mut().await;
187
188 let cancel = RcRef::map(self, |r| &r.cancel);
189
190 let buf_size = if limit < 1024 { limit } else { 1024 };
191 let mut buf = vec![0; buf_size];
192 let read = reader.read(&mut buf).try_or_cancel(cancel).await?;
193 buf.truncate(read);
194
195 Ok(buf.into())
196 })
197 }
198
199 fn read_byob(
200 self: Rc<Self>,

Callers

nothing calls this directly

Calls 1

readMethod · 0.65

Tested by

no test coverage detected