Skip to content

Select trait exposes private types #8422

Closed
@brson

Description

@brson

The Select trait - a public interface - uses the following pattern to hide private implementation details:

priv trait SelectInner { ... implementation details ... }

pub trait Select: SelectInner { ... public API ... }

This is the only place where we use this pattern and I think it's kind of dubious - Select's signature refers to a type that, from the user's perspective, doesn't exist. It's a leaky abstraction.

There may be similar patterns that are more palatable but uses a private enum variant - the enum type is public but opaque.

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