Skip to content

Docs say that deserialization without alloc is supported #66

@leighmcculloch

Description

@leighmcculloch

The docs appear to say:

//! - (De)serialization doesn't require memory allocations

//! - Supports deserialization of:
//! - `bool`
//! - Integers
//! - `str` (This is a zero copy operation.) (\*)

However, looking at the API, DeserializedOwned is required:

pub fn from_slice<T>(v: &[u8]) -> Result<T>
where
T: de::DeserializeOwned,

What's the right way to use the lib to do deserialisation with &str fields being a zero copy?

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions