(ctx: Context)
| 9 | }; |
| 10 | |
| 11 | pub fn create_serde_module(ctx: Context) -> ModuleKind { |
| 12 | let name = ctx.intern(b"std.serde"); |
| 13 | |
| 14 | let exports = [ |
| 15 | ("from_str", Value::NativeFunction(NativeFn(serde_from_str))), |
| 16 | ("to_str", Value::NativeFunction(NativeFn(serde_to_str))), |
| 17 | ( |
| 18 | "from_file", |
| 19 | Value::NativeFunction(NativeFn(serde_from_file)), |
| 20 | ), |
| 21 | ("to_file", Value::NativeFunction(NativeFn(serde_to_file))), |
| 22 | ] |
| 23 | .into_iter() |
| 24 | .map(|(name, f)| (ctx.intern_static(name), f)) |
| 25 | .collect(); |
| 26 | |
| 27 | ModuleKind::Native { name, exports } |
| 28 | } |
| 29 | |
| 30 | fn serde_from_str<'gc>( |
| 31 | state: &mut State<'gc>, |
no test coverage detected