Skip to content

Sealed trait connections::Slot #93

Open
@ratijas

Description

@ratijas

/// You should not implement this trait. It is already implemented for FnMut which has the

If this trait would be sealed, it would become impossible to implement by outsiders. It will also make the documentation line "You should not implement this trait" redundant, and enforce such restriction on a type level.

Steps to fix:

  1. Define private module seal inside connections
  2. Define bare pub trait Seal there
  3. Re-declare Slot as Slot: seal::Seal
  4. Implement seal::Seal for all relevant types inside connections module

Sample implementation of sealed pattern: https://github.com/ratijas/windows-rust-counters/blob/f03c769242f2c6b4d990155245aebf9a8cfc4a8c/signal-flow/src/interval.rs#L32-L40

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-rustArea: Rust glueC-enhancementCategory: An issue proposing an enhancement or a PR with one.E-easyCall for participation: Experience needed to fix: Easy / not muchP-lowLow priority

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions