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> {
1360
1360
impl < T : Read + Write + Unpin + fmt:: Debug > Connection < T > {
1361
1361
unsafe_pinned ! ( stream: ImapStream <T >) ;
1362
1362
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
+
1363
1373
/// Convert this connection into the raw underlying stream.
1364
1374
pub fn into_inner ( self ) -> T {
1365
1375
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> {
54
54
Ok ( ( ) )
55
55
}
56
56
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.
57
68
pub fn into_inner ( self ) -> R {
58
69
self . inner
59
70
}
You can’t perform that action at this time.
0 commit comments