Struct parity_ws::Frame[][src]

pub struct Frame { /* fields omitted */ }

A struct representing a WebSocket frame.

Implementations

impl Frame[src]

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

Get the length of the frame. This is the length of the header + the length of the payload.

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

Return false: a frame is never empty since it has a header.

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

Test whether the frame is a final frame.

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

Test whether the first reserved bit is set.

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

Test whether the second reserved bit is set.

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

Test whether the third reserved bit is set.

pub fn opcode(&self) -> OpCode[src]

Get the OpCode of the frame.

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

Test whether this is a control frame.

pub fn payload(&self) -> &Vec<u8>

Notable traits for Vec<u8, A>

impl<A> Write for Vec<u8, A> where
    A: Allocator
[src]

Get a reference to the frame’s payload.

pub fn set_final(&mut self, is_final: bool) -> &mut Frame[src]

Make this frame a final frame.

pub fn set_rsv1(&mut self, has_rsv1: bool) -> &mut Frame[src]

Set the first reserved bit.

pub fn set_rsv2(&mut self, has_rsv2: bool) -> &mut Frame[src]

Set the second reserved bit.

pub fn set_rsv3(&mut self, has_rsv3: bool) -> &mut Frame[src]

Set the third reserved bit.

pub fn set_opcode(&mut self, opcode: OpCode) -> &mut Frame[src]

Set the OpCode.

pub fn payload_mut(&mut self) -> &mut Vec<u8>

Notable traits for Vec<u8, A>

impl<A> Write for Vec<u8, A> where
    A: Allocator
[src]

Edit the frame’s payload.

pub fn into_data(self) -> Vec<u8>

Notable traits for Vec<u8, A>

impl<A> Write for Vec<u8, A> where
    A: Allocator
[src]

Consume the frame into its payload.

pub fn message(data: Vec<u8>, code: OpCode, finished: bool) -> Frame[src]

Create a new data frame.

pub fn pong(data: Vec<u8>) -> Frame[src]

Create a new Pong control frame.

pub fn ping(data: Vec<u8>) -> Frame[src]

Create a new Ping control frame.

pub fn close(code: CloseCode, reason: &str) -> Frame[src]

Create a new Close control frame.

pub fn parse(
    cursor: &mut Cursor<CappedBuffer>,
    max_payload_length: u64
) -> Result<Option<Frame>>
[src]

Parse the input stream into a frame.

pub fn format<W>(&mut self, w: &mut W) -> Result<()> where
    W: Write
[src]

Write a frame out to a buffer

Trait Implementations

impl Clone for Frame[src]

impl Debug for Frame[src]

impl Default for Frame[src]

impl Display for Frame[src]

Auto Trait Implementations

impl RefUnwindSafe for Frame

impl Send for Frame

impl Sync for Frame

impl Unpin for Frame

impl UnwindSafe for Frame

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> ToString for T where
    T: Display + ?Sized
[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<V, T> VZip<V> for T where
    V: MultiLane<T>, 
[src]