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

Method read_byob

components/runtime/src/extensions/httpclient.rs:199–210  ·  view source on GitHub ↗
(
        self: Rc<Self>,
        mut buf: deno_core::BufMutView,
    )

Source from the content-addressed store, hash-verified

197 }
198
199 fn read_byob(
200 self: Rc<Self>,
201 mut buf: deno_core::BufMutView,
202 ) -> AsyncResult<(usize, deno_core::BufMutView)> {
203 Box::pin(async move {
204 let mut reader = RcRef::map(&self, |r| &r.body).borrow_mut().await;
205
206 let cancel = RcRef::map(self, |r| &r.cancel);
207 let read = reader.read(&mut buf).try_or_cancel(cancel).await?;
208 Ok((read, buf))
209 })
210 }
211
212 fn close(self: Rc<Self>) {
213 self.cancel.cancel()

Callers

nothing calls this directly

Calls 1

readMethod · 0.65

Tested by

no test coverage detected