MCPcopy Create free account
hub / github.com/awslabs/llrt / read

Method read

modules/llrt_stream/src/readable.rs:173–179  ·  view source on GitHub ↗
(this: This<Class<'js, Self>>, ctx: Ctx<'js>, size: Opt<usize>)

Source from the content-addressed store, hash-verified

171 }
172
173 fn read(this: This<Class<'js, Self>>, ctx: Ctx<'js>, size: Opt<usize>) -> Result<Value<'js>> {
174 if let Some(data) = this.borrow().inner().buffer.read(size.0) {
175 return Buffer(data).into_js(&ctx);
176 }
177
178 Ok(Null.into_value(ctx))
179 }
180
181 fn drain(this: Class<'js, Self>, ctx: &Ctx<'js>) -> Result<()> {
182 let this2 = this.clone();

Callers

nothing calls this directly

Implementers 2

readable.rsmodules/llrt_stream/src/readable.rs
socket.rsmodules/llrt_net/src/socket.rs

Calls 5

readMethod · 0.65
BufferClass · 0.50
innerMethod · 0.45
into_jsMethod · 0.45
into_valueMethod · 0.45

Tested by

no test coverage detected