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

Method from_string_encoding

modules/llrt_buffer/src/buffer.rs:87–99  ·  view source on GitHub ↗
(
        ctx: &Ctx<'js>,
        string: String,
        encoding: Option<String>,
    )

Source from the content-addressed store, hash-verified

85
86 fn from_array_buffer_offset_length(
87 ctx: &Ctx<'js>,
88 array_buffer: ArrayBuffer<'js>,
89 offset: usize,
90 length: usize,
91 ) -> Result<Value<'js>> {
92 BufferPrimordials::get(ctx)?
93 .constructor
94 .construct((array_buffer, offset, length))
95 }
96
97 fn from_encoding(
98 ctx: &Ctx<'js>,
99 mut bytes: Vec<u8>,
100 encoding: Option<String>,
101 ) -> Result<Value<'js>> {
102 if let Some(encoding) = encoding {

Callers

nothing calls this directly

Calls 5

or_throwMethod · 0.80
decode_from_stringMethod · 0.80
into_bytesMethod · 0.80
BufferClass · 0.70
into_jsMethod · 0.45

Tested by

no test coverage detected