Struct parity_ws::Frame[][src]

pub struct Frame { /* fields omitted */ }
Expand description

A struct representing a WebSocket frame.

Implementations

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

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

Test whether the frame is a final frame.

Test whether the first reserved bit is set.

Test whether the second reserved bit is set.

Test whether the third reserved bit is set.

Get the OpCode of the frame.

Test whether this is a control frame.

Get a reference to the frame’s payload.

Make this frame a final frame.

Set the first reserved bit.

Set the second reserved bit.

Set the third reserved bit.

Set the OpCode.

Edit the frame’s payload.

Consume the frame into its payload.

Create a new data frame.

Create a new Pong control frame.

Create a new Ping control frame.

Create a new Close control frame.

Parse the input stream into a frame.

Write a frame out to a buffer

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Returns the “default value” for a type. Read more

Formats the value using the given formatter. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

Should always be Self

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

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

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

Converts the given value to a String. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.