File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -641,8 +641,12 @@ pub struct OutgoingZeroRttData {
641641 accepted : Shared < ZeroRttAccepted > ,
642642}
643643
644+ mod sealed {
645+ pub trait Sealed { }
646+ }
647+
644648/// Trait to track the state of a [`Connection`] at compile time.
645- pub trait ConnectionState {
649+ pub trait ConnectionState : sealed :: Sealed {
646650 /// State-specific data stored in the [`Connection`].
647651 type Data : std:: fmt:: Debug + Clone ;
648652}
@@ -659,12 +663,15 @@ pub struct IncomingZeroRtt;
659663#[ derive( Debug , Clone ) ]
660664pub struct OutgoingZeroRtt ;
661665
666+ impl sealed:: Sealed for HandshakeCompleted { }
662667impl ConnectionState for HandshakeCompleted {
663668 type Data = HandshakeCompletedData ;
664669}
670+ impl sealed:: Sealed for IncomingZeroRtt { }
665671impl ConnectionState for IncomingZeroRtt {
666672 type Data = IncomingZeroRttData ;
667673}
674+ impl sealed:: Sealed for OutgoingZeroRtt { }
668675impl ConnectionState for OutgoingZeroRtt {
669676 type Data = OutgoingZeroRttData ;
670677}
You can’t perform that action at this time.
0 commit comments