Skip to content

Consider Visit::visit_key + Visit::visit_value #65

Open
@KodrAus

Description

@KodrAus

The Visit trait has a visit_entry method that accepts a key-value pair. In cases where you’re bridging different APIs you might not be able to guarantee both the key and value are present at the same time to pass to this method. For instance, serde::SerializeMap treats entries as an optimization and requires serializers support receiving keys and values independently. We ended up adding these separate methods to the standard library’s fmt builders for this reason.

We could consider making visit_entry forward to some new visit_key and visit_value methods.

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