#vector #io #writev #readv

vecio

Vector IO, scatter/gather, writev, readv

1 unstable release

0.1.0 Dec 2, 2015

#34 in Rust patterns

Download history 135/week @ 2018-08-21 153/week @ 2018-08-28 128/week @ 2018-09-04 181/week @ 2018-09-11 150/week @ 2018-09-18 79/week @ 2018-09-25 122/week @ 2018-10-02 150/week @ 2018-10-09 181/week @ 2018-10-16 106/week @ 2018-10-23 289/week @ 2018-10-30 416/week @ 2018-11-06 428/week @ 2018-11-13

3,599 downloads per month
Used in 3 crates

MIT license

7KB
167 lines

vecio

Unix Status Windows status

Vector IO, scatter/gather, readv, writev

Works on file descriptors on Unix, and sockets on Windows.

Example

extern crate vecio;

use vecio::Rawv;
use std::net::TcpStream;

fn main() {
    let mut stream = TcpStream::connect("0.0.0.0").unwrap();
    stream.writev(&[b"foo", b"bar"]).unwrap();
}

Details

There are 3 traits of import in vecio:

  • Rawv
  • Writev
  • Readv

The Rawv trait implements Writev and Readv for any type that implements either AsRawFd or AsRawSocket (unix and windows).

The Writev and Readv traits exist so that any type that needs a custom implementation can have one.

In simple cases, just import vecio::Rawv will give the methods on the proper types.


lib.rs:

vecio

Vector IO operations, commonly referred to as scatter/gather IO.

Dependencies

~157KB