mirror of
https://github.com/tlsnotary/tlsn-utils.git
synced 2026-01-09 20:57:56 -05:00
feat(codec): add getters for Framed (#67)
* feat(codec): add getters for `Framed` * improve doc
This commit is contained in:
@@ -99,6 +99,31 @@ impl<T, C> Framed<T, C> {
|
||||
pub fn new(inner: T, codec: C) -> Self {
|
||||
Self { inner, codec }
|
||||
}
|
||||
|
||||
/// Returns a reference to the inner transport.
|
||||
pub fn inner(&self) -> &T {
|
||||
&self.inner
|
||||
}
|
||||
|
||||
/// Returns a mutable reference to the inner transport.
|
||||
pub fn inner_mut(&mut self) -> &mut T {
|
||||
&mut self.inner
|
||||
}
|
||||
|
||||
/// Returns a reference to the codec.
|
||||
pub fn codec(&self) -> &C {
|
||||
&self.codec
|
||||
}
|
||||
|
||||
/// Returns a mutable reference to the codec.
|
||||
pub fn codec_mut(&mut self) -> &mut C {
|
||||
&mut self.codec
|
||||
}
|
||||
|
||||
/// Returns the inner transport and codec.
|
||||
pub fn into_parts(self) -> (T, C) {
|
||||
(self.inner, self.codec)
|
||||
}
|
||||
}
|
||||
|
||||
impl<T, C> Sink for Framed<T, C>
|
||||
|
||||
Reference in New Issue
Block a user