Docs.rs
  • websocket-codec-0.5.2
    • websocket-codec 0.5.2
    • Permalink
    • Docs.rs crate page
    • MIT
    • Links
    • Repository
    • crates.io
    • Source
    • Owners
    • 1tgr
    • Dependencies
      • base64 ^0.13 normal
      • byteorder ^1 normal
      • bytes ^1 normal
      • httparse ^1 normal
      • rand ^0.8 normal
      • sha1 ^0.6 normal
      • tokio-util >=0.6 normal
      • criterion ^0.3 dev
      • quickcheck ^1 dev
      • quickcheck_macros ^1 dev
      • static_assertions ^1 dev
      • structopt ^0.3 dev
    • Versions
    • 100% of the crate is documented
  • Platform
    • i686-pc-windows-msvc
    • i686-unknown-linux-gnu
    • x86_64-apple-darwin
    • x86_64-pc-windows-msvc
    • x86_64-unknown-linux-gnu
  • Feature flags
  • docs.rs
    • About docs.rs
    • Privacy policy
  • Rust
    • Rust website
    • The Book
    • Standard Library API Reference
    • Rust by Example
    • The Cargo Guide
    • Clippy Documentation

Crate websocket_codec

websocket_codec0.5.2

  • All Items

Crate Items

  • Modules
  • Structs
  • Enums
  • Type Aliases

Crates

  • websocket_codec

Crate websocket_codec

Source
Expand description

A Tokio codec implementation of the WebSocket protocol.

This crate does not do any I/O directly. For a full WebSocket client, see the websocket-lite crate.

Modules§

protocol
Holds types that define WebSocket data at a low level.

Structs§

ClientRequest
A client’s opening handshake.
Message
A text string, a block of binary data or a WebSocket control frame.
MessageCodec
Tokio codec for WebSocket messages. This codec can send and receive Message structs.
UpgradeCodec
Tokio decoder for parsing the server’s response to the client’s HTTP Connection: Upgrade request.

Enums§

Opcode
Represents an opcode as defined by the WebSocket protocol.

Type Aliases§

Error
Represents errors that can be exposed by this crate.
Result
Represents results returned by the non-async functions in this crate.

Results

Settings
Help
    struct
    websocket_codec::Message
    A text string, a block of binary data or a WebSocket …
    struct
    websocket_codec::MessageCodec
    Tokio codec for WebSocket messages. This codec can send …
    method
    websocket_codec::Message::into_data
    Message -> Bytes
    Consumes the message, returning its data.
    method
    websocket_codec::Message::clone
    &Message -> Message
    method
    websocket_codec::Message::opcode
    &Message -> Opcode
    Returns this message’s WebSocket opcode.
    method
    websocket_codec::Message::data
    &Message -> &Bytes
    Returns a reference to the data held in this message.
    method
    websocket_codec::Message::eq
    &Message, &Message -> bool
    method
    websocket_codec::Message::as_text
    &Message -> Option<&str>
    For messages with opcode Opcode::Text, returns a reference …
    method
    websocket_codec::Message::fmt
    &Message, &mut Formatter -> Result
    method
    websocket_codec::MessageCodec::encode
    &mut MessageCodec, Message, &mut BytesMut -> Result<()>
    method
    websocket_codec::Message::ping
    B -> Message
    Creates a message requesting a pong response.
    method
    websocket_codec::Message::pong
    B -> Message
    Creates a response to a ping message.
    method
    websocket_codec::Message::text
    S -> Message
    Creates a text message from a String.
    method
    websocket_codec::Message::binary
    B -> Message
    Creates a binary message from any type that can be …
    method
    websocket_codec::Message::close
    Option<(u16, String)> -> Message
    Creates a message that indicates the connection is about …
    method
    websocket_codec::Message::new
    Opcode, B -> Result<Message, Utf8Error>
    Creates a message from a Bytes object.
    method
    websocket_codec::Message::clone
    &Message -> Message