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

Method end

modules/llrt_string_decoder/src/string_decoder.rs:239–253  ·  view source on GitHub ↗
(&mut self, ctx: Ctx<'_>, buffer: Opt<ArrayBufferView<'_>>)

Source from the content-addressed store, hash-verified

237 encoder,
238 buffer: Vec::new(),
239 buffered_bytes: 0,
240 missing_bytes: 0,
241 })
242 }
243
244 #[qjs(get)]
245 pub fn encoding(&self) -> &str {
246 self.encoder.as_label()
247 }
248
249 pub fn end(&mut self, ctx: Ctx<'_>, buffer: Opt<ArrayBufferView<'_>>) -> Result<String> {
250 let output = if let Some(data) = buffer.0.as_ref().and_then(|b| b.as_bytes()) {
251 Some(self.decode_data(&ctx, data)?)
252 } else {
253 None
254 };
255
256 let flush = self.flush(&ctx)?;

Callers 3

testDecodeFunction · 0.95
testEndFunction · 0.95
testBufFunction · 0.95

Calls 3

decode_dataMethod · 0.80
as_bytesMethod · 0.45
flushMethod · 0.45

Tested by 3

testDecodeFunction · 0.76
testEndFunction · 0.76
testBufFunction · 0.76