Enum tk_http::websocket::Frame [] [src]

pub enum Frame<'a> {
    Ping(&'a [u8]),
    Pong(&'a [u8]),
    Text(&'a str),
    Binary(&'a [u8]),
    Close(u16, &'a str),
}

A borrowed frame of websocket data

Variants

Ping mesage

Pong mesage

Text (utf-8) message

Binary message

Close message

Methods

impl<'a> Frame<'a>
[src]

[src]

Parse a frame for the specified buffer

Returns a frame and a number of bytes or None if no full frame was in the buffer. After frame is processes you should use buf.consume(nbytes).

[src]

Write a frame into specified buffer

masked should be true for client socket and false for servers socket according to the spec

Trait Implementations

impl<'a> From<&'a Packet> for Frame<'a>
[src]

[src]

Performs the conversion.

impl<'a> Debug for Frame<'a>
[src]

[src]

Formats the value using the given formatter.

impl<'a> Clone for Frame<'a>
[src]

[src]

Returns a copy of the value. Read more

1.0.0
[src]

Performs copy-assignment from source. Read more

impl<'a> PartialEq for Frame<'a>
[src]

[src]

This method tests for self and other values to be equal, and is used by ==. Read more

[src]

This method tests for !=.

impl<'a> Into<Packet> for Frame<'a>
[src]

[src]

Performs the conversion.

impl<'a> Into<Packet> for &'a Frame<'a>
[src]

[src]

Performs the conversion.