From 814640cccd03458e917da7fb011b23f3065dfb09 Mon Sep 17 00:00:00 2001 From: Matthias Seitz Date: Wed, 16 Nov 2022 20:11:47 +0100 Subject: [PATCH] chore(net): add helper access functions for wrapped stream (#216) --- crates/net/eth-wire/src/ethstream.rs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/crates/net/eth-wire/src/ethstream.rs b/crates/net/eth-wire/src/ethstream.rs index c8945b056c..e7d5a523ce 100644 --- a/crates/net/eth-wire/src/ethstream.rs +++ b/crates/net/eth-wire/src/ethstream.rs @@ -130,6 +130,16 @@ impl EthStream { pub fn new(inner: S) -> Self { Self { inner } } + + /// Returns the underlying stream. + pub fn inner(&self) -> &S { + &self.inner + } + + /// Returns mutable access to the underlying stream. + pub fn inner_mut(&mut self) -> &mut S { + &mut self.inner + } } impl Stream for EthStream