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

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]

Formats the value using the given formatter. Read more

Auto Trait Implementations

impl Send for Buffer

impl Sync for Buffer

Blanket Implementations

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

Performs the conversion.

impl<T> From for T
[src]

Performs the conversion.

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

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

🔬 This is a nightly-only experimental API. (try_from)

Performs the conversion.

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

Immutably borrows from an owned value. Read more

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

Mutably borrows from an owned value. Read more

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

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

🔬 This is a nightly-only experimental API. (try_from)

Performs the conversion.

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

🔬 This is a nightly-only experimental API. (get_type_id)

this method will likely be replaced by an associated static

Gets the TypeId of self. Read more

impl<T> Typeable for T where
    T: Any
[src]

Get the TypeId of this object.

impl<T> Erased for T
[src]