Struct websocket::server::upgrade::sync::Buffer [] [src]

pub struct Buffer {
    pub buf: Vec<u8>,
    pub pos: usize,
    pub cap: usize,
}

This crate uses buffered readers to read in the handshake quickly, in order to interface with other use cases that don't use buffered readers the buffered readers is deconstructed when it is returned to the user and given as the underlying reader and the buffer.

This struct represents bytes that have already been read in from the stream. A slice of valid data in this buffer can be obtained by: &buf[pos..cap].

Fields

the contents of the buffered stream data

the current position of cursor in the buffer Any data before pos has already been read and parsed.

the last location of valid data Any data after cap is not valid.

Trait Implementations

impl Debug for Buffer
[src]

[src]

Formats the value using the given formatter. Read more

Auto Trait Implementations

impl Send for Buffer

impl Sync for Buffer