wslay-sys 0.1.0

Low-level FFI bindings to the wslay WebSocket C library (vendored).
Documentation
  • Coverage
  • 0.79%
    1 out of 127 items documented0 out of 11 items with examples
  • Size
  • Source code size: 110.74 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 1.49 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 16s Average build duration of successful builds.
  • all releases: 16s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • Repository
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • debdattabasu

wslay-sys

Low-level Rust FFI bindings to wslay, Tatsuhiro Tsujikawa's WebSocket C library.

The wslay C sources are vendored in this crate and compiled at build time with cc; the bindings are generated with bindgen. No system wslay installation is required.

This crate exposes wslay's event-based API verbatim — it is unsafe FFI only. For a safe, async wrapper (and a full-duplex WebSocket⇄byte-stream bridge with true sub-frame streaming), see ws-tcp.

Why wslay

wslay's event API, with wslay_event_config_set_no_buffering, delivers frame payloads incrementally via on_frame_recv_chunk_callback — it never buffers a whole frame, no matter how large. It performs no I/O itself (callback-driven), so it drops cleanly into async runtimes.

Build requirements

  • A C compiler (cc finds one automatically).
  • libclang (required by bindgen). On macOS it ships with the Command Line Tools; on Debian/Ubuntu install libclang-dev.

License

This crate is MIT-licensed. The vendored wslay sources are also MIT-licensed — see vendor/COPYING.

Part of h2ts.