Skip to content

seanmonstar/vecio

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

vecio

Unix Status Windows status crates.io

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.

License

Licensed under either of

at your option.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

About

No description, website, or topics provided.

Resources

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT

Stars

Watchers

Forks

Packages

No packages published

Languages