cloudwego / cloudwego/sonic-rs

Parse `OwnedLazyValue` into a custom struct

Open
#194 3 comments 0 reactions 0 assignees View on GitHub
Dominant language
Rust
Stars
920
Forks
68
Avg merge
2h 5m
Merged PRs (30d)
1

Description

**Is your feature request related to a problem? Please describe.**

For `Value`, we can use `sonic_rs::from_value` to parse it into a custom struct.
For `LazyValue`, we can use `LazyValue::as_raw_str` to access raw str, than use `sonic_rs::from_str` to parse it into a custom struct.
But for `OwnedLazyValue`, I don't know how to parse it into a custom struct. In version 0.3, I can also use `as_raw_str` to process it, but the current version does not have this method.

**Describe the solution you'd like**
maybe like this
```rust
let foo: Foo = Foo::deserialize(owned_lazy_value)?;
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.