pub(crate) struct Buffered<T, B> {
flush_pipeline: bool,
io: T,
read_blocked: bool,
read_buf: BytesMut,
read_buf_strategy: ReadStrategy,
write_buf: WriteBuf<B>,
}
Fields§
§flush_pipeline: bool
§io: T
§read_blocked: bool
§read_buf: BytesMut
§read_buf_strategy: ReadStrategy
§write_buf: WriteBuf<B>
Implementations§
source§impl<T, B> Buffered<T, B>
impl<T, B> Buffered<T, B>
pub(crate) fn new(io: T) -> Buffered<T, B>
pub(crate) fn set_flush_pipeline(&mut self, enabled: bool)
pub(crate) fn set_max_buf_size(&mut self, max: usize)
pub(crate) fn set_read_buf_exact_size(&mut self, sz: usize)
pub(crate) fn set_write_strategy_flatten(&mut self)
pub(crate) fn set_write_strategy_queue(&mut self)
pub(crate) fn read_buf(&self) -> &[u8] ⓘ
sourcefn read_buf_remaining_mut(&self) -> usize
fn read_buf_remaining_mut(&self) -> usize
Return the “allocated” available space, not the potential space that could be allocated in the future.
sourcepub(crate) fn can_headers_buf(&self) -> bool
pub(crate) fn can_headers_buf(&self) -> bool
Return whether we can append to the headers buffer.
Reasons we can’t:
- The write buf is in queue mode, and some of the past body is still needing to be flushed.
pub(crate) fn headers_buf(&mut self) -> &mut Vec<u8>
pub(super) fn write_buf(&mut self) -> &mut WriteBuf<B>
pub(crate) fn buffer<BB: Buf + Into<B>>(&mut self, buf: BB)
pub(crate) fn can_buffer(&self) -> bool
pub(crate) fn consume_leading_lines(&mut self)
pub(super) fn parse<S>(
&mut self,
cx: &mut Context<'_>,
parse_ctx: ParseContext<'_>,
) -> Poll<Result<ParsedMessage<S::Incoming>>>where
S: Http1Transaction,
pub(crate) fn poll_read_from_io( &mut self, cx: &mut Context<'_>, ) -> Poll<Result<usize>>
pub(crate) fn into_inner(self) -> (T, Bytes)
pub(crate) fn io_mut(&mut self) -> &mut T
pub(crate) fn is_read_blocked(&self) -> bool
pub(crate) fn poll_flush(&mut self, cx: &mut Context<'_>) -> Poll<Result<()>>
Trait Implementations§
impl<T: Unpin, B> Unpin for Buffered<T, B>
Auto Trait Implementations§
impl<T, B> Freeze for Buffered<T, B>where
T: Freeze,
impl<T, B> RefUnwindSafe for Buffered<T, B>where
T: RefUnwindSafe,
B: RefUnwindSafe,
impl<T, B> Send for Buffered<T, B>
impl<T, B> Sync for Buffered<T, B>
impl<T, B> UnwindSafe for Buffered<T, B>where
T: UnwindSafe,
B: UnwindSafe,
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more