[][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

impl Unpin for Buffer

impl UnwindSafe for Buffer

impl RefUnwindSafe for Buffer

Blanket Implementations

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

impl<T> From<T> for T[src]

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

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> 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<T> for T where
    T: ?Sized
[src]

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

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

impl<T> Typeable for T where
    T: Any

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,