Skip to content

Parse OwnedLazyValue into a custom struct #194

@themanforfree

Description

@themanforfree

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

    let foo: Foo = Foo::deserialize(owned_lazy_value)?;

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions