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

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

buf: Vec<u8>

the contents of the buffered stream data

pos: usize

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

cap: usize

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

Trait Implementations

impl Debug for Buffer[src]

Auto Trait Implementations

impl Send for Buffer

impl Sync for Buffer

Blanket Implementations

impl<T> From for T[src]

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T> BorrowMut for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Typeable for T where
    T: Any

fn get_type(&self) -> TypeId

Get the TypeId of this object.

impl<T> Erased for T