Skip to content

Spanned elements #43

@ratmice

Description

@ratmice

One thing which might be worth thinking about is whether the difference in data model allow deser to implement Spanned,
In the following comment dtolnay says serde's model is not necessarily byte oriented.
serde-rs/serde#1811 (comment)

if deser's model is, perhaps it could be worth including.

A few serde serializer/deserializer implementations implement it directly.

https://crates.io/crates/json-spanned-value
https://docs.rs/toml/latest/toml/struct.Spanned.html

But even with these, there are for instance odd interactions with Default.
Presumably a span for a default element could be one of None for an optional span type, or alternately the Span of any enclosing element?

Anyhow, it seemed worth thinking about perhaps, but doesn't seem to be essential.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions