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

Method get

modules/llrt_fetch/src/form_data.rs:93–105  ·  view source on GitHub ↗
(&self, ctx: Ctx<'js>, name: String)

Source from the content-addressed store, hash-verified

91 value: Value<'js>,
92 filename: Opt<String>,
93 ) -> Result<()> {
94 let entry = value_to_form_entry(&ctx, name, value, filename)?;
95 self.entries.borrow_mut().push(entry);
96 Ok(())
97 }
98
99 pub fn get(&self, ctx: Ctx<'js>, name: String) -> Result<Value<'js>> {
100 let value = self
101 .entries
102 .borrow()
103 .iter()
104 .find(|(k, _)| *k == name)
105 .map(|(_, v)| v.clone());
106 match value {
107 Some(v) => v.into_js(&ctx),
108 None => Ok(Value::new_null(ctx)),

Callers

nothing calls this directly

Calls 4

okMethod · 0.80
iterMethod · 0.45
cloneMethod · 0.45
into_jsMethod · 0.45

Tested by

no test coverage detected