Struct soketto::base::Codec[][src]

pub struct Codec { /* fields omitted */ }

Codec for encoding/decoding websocket base frames.

Implementations

impl Codec[src]

pub fn new() -> Self[src]

Create a new base frame codec.

The codec will support decoding payload lengths up to 256 MiB (use set_max_data_size to change this value).

pub fn max_data_size(&self) -> usize[src]

Get the configured maximum payload length.

pub fn set_max_data_size(&mut self, size: usize) -> &mut Self[src]

Limit the maximum size of payload data to size bytes.

pub fn reserved_bits(&self) -> (bool, bool, bool)[src]

The reserved bits currently configured.

pub fn add_reserved_bits(&mut self, bits: (bool, bool, bool)) -> &mut Self[src]

Add to the reserved bits in use.

pub fn clear_reserved_bits(&mut self)[src]

Reset the reserved bits.

pub fn decode_header(
    &self,
    bytes: &[u8]
) -> Result<Parsing<Header, usize>, Error>
[src]

Decode a websocket frame header.

pub fn encode_header(&mut self, header: &Header) -> &[u8][src]

Encode a websocket frame header.

pub fn apply_mask(header: &Header, data: &mut [u8])[src]

Use the given header’s mask and apply it to the data.

Trait Implementations

impl Clone for Codec[src]

impl Debug for Codec[src]

impl Default for Codec[src]

Auto Trait Implementations

impl RefUnwindSafe for Codec

impl Send for Codec

impl Sync for Codec

impl Unpin for Codec

impl UnwindSafe for Codec

Blanket Implementations

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

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

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

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

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

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

type Output = T

Should always be Self

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

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<V, T> VZip<V> for T where
    V: MultiLane<T>, 
[src]