-
Notifications
You must be signed in to change notification settings - Fork 92
Open
Labels
A-rustArea: Rust glueArea: Rust glueC-enhancementCategory: An issue proposing an enhancement or a PR with one.Category: An issue proposing an enhancement or a PR with one.E-easyCall for participation: Experience needed to fix: Easy / not muchCall for participation: Experience needed to fix: Easy / not muchP-lowLow priorityLow priority
Description
qmetaobject-rs/qmetaobject/src/connections.rs
Line 162 in 5d1f561
/// 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:
- Define private module
seal
insideconnections
- Define bare
pub trait Seal
there - Re-declare
Slot
asSlot: seal::Seal
- Implement
seal::Seal
for all relevant types insideconnections
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
Labels
A-rustArea: Rust glueArea: Rust glueC-enhancementCategory: An issue proposing an enhancement or a PR with one.Category: An issue proposing an enhancement or a PR with one.E-easyCall for participation: Experience needed to fix: Easy / not muchCall for participation: Experience needed to fix: Easy / not muchP-lowLow priorityLow priority