Skip to content

Commit 24beb23

Browse files
authored
Merge pull request #55 from tmccombs/listener-method
feat: Add listener() method
2 parents 5f2f3e0 + 6aad47c commit 24beb23

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/lib.rs

+8
Original file line numberDiff line numberDiff line change
@@ -259,6 +259,14 @@ where
259259
pub fn connections(self) -> impl Stream<Item = Result<T::Stream, TlsListenerError<A, T>>> {
260260
self.map_ok(|(conn, _addr)| conn)
261261
}
262+
263+
/// Get a reference to the underlying connection listener
264+
///
265+
/// Can be useful to get metadata about the listener, such as the
266+
/// local address.
267+
pub fn listener(&self) -> &A {
268+
&self.listener
269+
}
262270
}
263271

264272
impl<A, T> Stream for TlsListener<A, T>

0 commit comments

Comments
 (0)