Skip to content

Add Deserialize impls for DeValue and De* variant types #1010

@Aaron1011

Description

@Aaron1011

From what I can tell, there are currently two ways of preserving span information when deserializing:

  1. Write a custom type (e.g. MyTable { table_field: Spanned<String> }) which uses Spanned on field types. This will preserve span information at any depth (assuming all of the nested types use Spanned), but requires deserializing into a specific format.
  2. Deserialize a Spanned<toml::Value>. This works with arbitrary input toml, but only preserves the outermost layer of span information (since toml::Value does not track any span information)

It would be very useful if toml::de::DeValue (and related De* types) implemented Deserialize. This would allow deserializing an arbitrary input toml value, while still preserving span information for all nested keys and values.

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