项目作者: djg

项目描述 :
Helper for working with Unix Domain Socket ancilliary control messages.
高级语言: Rust
项目地址: git://github.com/djg/cmsg-rs.git
创建时间: 2017-10-11T00:14:42Z
项目社区:https://github.com/djg/cmsg-rs

开源协议:MIT License

下载


cmsg

Build Status

A library for working with ancilliary control messages for Unix Domain Sockets as described by cmsg.

  1. # Cargo.toml
  2. [dependencies]
  3. bytes = "0.4"
  4. cmsg = "0.1"

Usage

To process received control messages, cmsg::iterator() is used to
create an iterator adapter over the raw bytes received from
libc::recvmsg.

To create control messages, cmsg::builder() is used to create a
builder interface over the top of pre-allocated storage. Using
Vec<u8>, bytes::BytesMut, and stack-based arrays, via
std::io::Cursor are supported. The builder checks that the storages
is correctly aligned and maintains alignment of each appended message.

License

cmsg-rs is primarily distributed under the terms of the MIT license.

See LICENSE-MIT for details.