Skip to content

postcard-schema: how to handle schemas conditional on is_human_readable() #197

@max-heller

Description

@max-heller

Some Serialize/Deserialize implementations (see e.g. uuid::Uuid) use different serde data model representations of the type depending on whether the underlying Serializer/Deserializer is human readable. For the most part, postcard should be able to think only in terms of the non-human-readable representation, but the distinction may matter for postcard-dyn in order to properly deserialize from human readable formats or serialize to human readable formats (e.g., json).

This could be captured in the schema as something like an IfHumanReadable { then: Type, else: Type } schema variant, though that feels somewhat clunky.

Metadata

Metadata

Assignees

No one assigned

    Labels

    postcard-schemaRelated to the postcard-schema crate

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions