Struct soketto::base::Codec [−][src]
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]
&self,
bytes: &[u8]
) -> Result<Parsing<Header, usize>, Error>
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
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]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Same<T> for T
[src]
type Output = T
Should always be Self
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
[src]
V: MultiLane<T>,