File tree Expand file tree Collapse file tree 2 files changed +21
-0
lines changed Expand file tree Collapse file tree 2 files changed +21
-0
lines changed Original file line number Diff line number Diff line change @@ -1360,6 +1360,16 @@ impl<T: Read + Write + Unpin + fmt::Debug + Send> Session<T> {
13601360impl < T : Read + Write + Unpin + fmt:: Debug > Connection < T > {
13611361 unsafe_pinned ! ( stream: ImapStream <T >) ;
13621362
1363+ /// Gets a reference to the underlying stream.
1364+ pub fn get_ref ( & self ) -> & T {
1365+ self . stream . get_ref ( )
1366+ }
1367+
1368+ /// Gets a mutable reference to the underlying stream.
1369+ pub fn get_mut ( & mut self ) -> & mut T {
1370+ self . stream . get_mut ( )
1371+ }
1372+
13631373 /// Convert this connection into the raw underlying stream.
13641374 pub fn into_inner ( self ) -> T {
13651375 let Self { stream, .. } = self ;
Original file line number Diff line number Diff line change @@ -54,6 +54,17 @@ impl<R: Read + Write + Unpin> ImapStream<R> {
5454 Ok ( ( ) )
5555 }
5656
57+ /// Gets a reference to the underlying stream.
58+ pub fn get_ref ( & self ) -> & R {
59+ & self . inner
60+ }
61+
62+ /// Gets a mutable reference to the underlying stream.
63+ pub fn get_mut ( & mut self ) -> & mut R {
64+ & mut self . inner
65+ }
66+
67+ /// Returns underlying stream.
5768 pub fn into_inner ( self ) -> R {
5869 self . inner
5970 }
You can’t perform that action at this time.
0 commit comments