codec: expose backpressure_boundary in Framed API (#5124)

This commit is contained in:
crusader-mike
2022-10-29 14:59:22 +00:00
committed by GitHub
parent 1ab80ba580
commit cbbf81b922
4 changed files with 37 additions and 12 deletions
+10
View File
@@ -253,6 +253,16 @@ impl<T, U> Framed<T, U> {
&mut self.inner.state.write.buffer
}
/// Returns backpressure boundary
pub fn backpressure_boundary(&self) -> usize {
self.inner.state.write.backpressure_boundary
}
/// Updates backpressure boundary
pub fn set_backpressure_boundary(&mut self, boundary: usize) {
self.inner.state.write.backpressure_boundary = boundary;
}
/// Consumes the `Framed`, returning its underlying I/O stream.
///
/// Note that care should be taken to not tamper with the underlying stream