Struct sozu_lib::network::buffer_queue::BufferQueue [] [src]

pub struct BufferQueue {
    pub buffer_position: usize,
    pub parsed_position: usize,
    pub output_position: usize,
    pub start_parsing_position: usize,
    pub buffer: Buffer,
    pub input_queue: Vec<InputElement>,
    pub output_queue: Vec<OutputElement>,
}

The BufferQueue has two roles: holding incoming data, and indicating which data will go out. When new data arrives, it is added at the end of the internal buffer. This new data is then eventually parsed or handled in some way by external code. The external code then adds element to the queue, indicating what to do with the data: - copy a subset of the input data (and advance if needed) - insert external data, like a HTTP header - splice out of the kernel some data that was spliced in

position is the index in the stream of data already handled. it corresponds to the beginning of available data in the Buffer a Slice(begin, end) would point to buffer.data()begin-position..end-position

unparsed_position is the index in the stream of data that was not parsed yet

The buffer's available data may be smaller than end - begin. It can happen if the parser indicated we need to copy more data than is available, like with a content length

should the buffer queue indicate how much data it needs?

Fields

position of buffer start in stream

Vec<(start, length)>

Methods

impl BufferQueue
[src]

should only be called with a count inferior to self.input_data_size()

should only be called with a count inferior to self.input_data_size()

Trait Implementations

impl Debug for BufferQueue
[src]

Formats the value using the given formatter.

impl PartialEq for BufferQueue
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

impl Clone for BufferQueue
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl Write for BufferQueue
[src]

Write a buffer into this object, returning how many bytes were written. Read more

Flush this output stream, ensuring that all intermediately buffered contents reach their destination. Read more

Attempts to write an entire buffer into this write. Read more

Writes a formatted string into this writer, returning any error encountered. Read more

Creates a "by reference" adaptor for this instance of Write. Read more

impl Reset for BufferQueue
[src]