From f8efabdce7070447d01dae1a09bb924dce8115bf Mon Sep 17 00:00:00 2001 From: Nikolay Kim Date: Fri, 5 Oct 2018 13:13:36 -0700 Subject: [PATCH] expose service and framed instances from framed transport --- src/framed.rs | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/src/framed.rs b/src/framed.rs index 3b69e017..5f1904d7 100644 --- a/src/framed.rs +++ b/src/framed.rs @@ -219,6 +219,29 @@ where flushed: true, } } + + /// Get reference to a service wrapped by `FramedTransport` instance. + pub fn get_ref(&self) -> &S { + &self.service + } + + /// Get mutable reference to a service wrapped by `FramedTransport` + /// instance. + pub fn get_mut(&mut self) -> &mut S { + &mut self.service + } + + /// Get reference to a framed instance wrapped by `FramedTransport` + /// instance. + pub fn get_framed(&self) -> &Framed { + &self.framed + } + + /// Get mutable reference to a framed instance wrapped by `FramedTransport` + /// instance. + pub fn get_framed_mut(&mut self) -> &mut Framed { + &mut self.framed + } } impl FramedTransport