MCPcopy Create free account
hub / github.com/chirpstack/chirpstack / rquickjs_to_struct

Function rquickjs_to_struct

chirpstack/src/codec/convert.rs:1–9  ·  view source on GitHub ↗
(val: &rquickjs::Value)

Source from the content-addressed store, hash-verified

1pub fn rquickjs_to_struct(val: &rquickjs::Value) -> pbjson_types::Struct {
2 if val.type_of() == rquickjs::Type::Object
3 && let Some(pbjson_types::value::Kind::StructValue(v)) = _rquickjs_to_struct_val(val)
4 {
5 return v;
6 }
7
8 Default::default()
9}
10
11fn _rquickjs_to_struct_val(val: &rquickjs::Value) -> Option<pbjson_types::value::Kind> {
12 match val.type_of() {

Callers 1

decodeFunction · 0.85

Calls 1

_rquickjs_to_struct_valFunction · 0.85

Tested by

no test coverage detected