Method
read_byob
(
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
Tested by
no test coverage detected