Commit 91d6fd7 1 parent 2d0aaef commit 91d6fd7 Copy full SHA for 91d6fd7
File tree 1 file changed +13
-2
lines changed
1 file changed +13
-2
lines changed Original file line number Diff line number Diff line change @@ -128,12 +128,14 @@ where
128
128
A :: Connection : AsyncRead + AsyncWrite + Unpin + ' static ,
129
129
A :: Error : std:: error:: Error ,
130
130
T : AsyncTls < A :: Connection > ,
131
- Self : Unpin ,
132
131
{
133
132
/// Accept the next connection
134
133
///
135
134
/// This is essentially an alias to `self.next()` with a more domain-appropriate name.
136
- pub fn accept ( & mut self ) -> impl Future < Output = Option < <Self as Stream >:: Item > > + ' _ {
135
+ pub fn accept ( & mut self ) -> impl Future < Output = Option < <Self as Stream >:: Item > > + ' _
136
+ where
137
+ Self : Unpin ,
138
+ {
137
139
self . next ( )
138
140
}
139
141
@@ -143,6 +145,15 @@ where
143
145
pub fn replace_acceptor ( & mut self , acceptor : T ) {
144
146
self . tls = acceptor;
145
147
}
148
+
149
+ /// Replaces the Tls Acceptor configuration from a pinned reference to `Self`.
150
+ ///
151
+ /// This is useful if your listener is `!Unpin`.
152
+ ///
153
+ /// This can be used to change the certificate used at runtime.
154
+ pub fn replace_acceptor_pin ( self : Pin < & mut Self > , acceptor : T ) {
155
+ * self . project ( ) . tls = acceptor;
156
+ }
146
157
}
147
158
148
159
impl < A , T > Stream for TlsListener < A , T >
You can’t perform that action at this time.
0 commit comments