mirror of
https://github.com/fafhrd91/actix-net
synced 2025-06-29 03:54:57 +02:00
Framed::is_write_buf_empty() checks if write buffer is flushed
This commit is contained in:
@ -135,6 +135,11 @@ impl<T, U> Framed<T, U> {
|
||||
&mut self.inner.get_mut().get_mut().0
|
||||
}
|
||||
|
||||
/// Check if write buffer is empty.
|
||||
pub fn is_write_buf_empty(&self) -> bool {
|
||||
self.inner.get_ref().is_empty()
|
||||
}
|
||||
|
||||
/// Check if write buffer is full.
|
||||
pub fn is_write_buf_full(&self) -> bool {
|
||||
self.inner.get_ref().is_full()
|
||||
|
@ -77,6 +77,11 @@ impl<T, E> FramedWrite<T, E> {
|
||||
pub fn is_full(&self) -> bool {
|
||||
self.inner.is_full()
|
||||
}
|
||||
|
||||
/// Check if write buffer is empty.
|
||||
pub fn is_empty(&self) -> bool {
|
||||
self.inner.is_empty()
|
||||
}
|
||||
}
|
||||
|
||||
impl<T, E> FramedWrite<T, E>
|
||||
@ -194,6 +199,10 @@ impl<T> FramedWrite2<T> {
|
||||
pub fn is_full(&self) -> bool {
|
||||
self.buffer.len() >= self.high_watermark
|
||||
}
|
||||
|
||||
pub fn is_empty(&self) -> bool {
|
||||
self.buffer.is_empty()
|
||||
}
|
||||
}
|
||||
|
||||
impl<T> FramedWrite2<T>
|
||||
|
@ -45,4 +45,4 @@ impl Token {
|
||||
self.0 += 1;
|
||||
token
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user