network-reader-adapter 0.1.0

A client/server protocol for using `io::Read` and `io::Seek` over a network
Documentation
  • Coverage
  • 0%
    0 out of 7 items documented0 out of 6 items with examples
  • Size
  • Source code size: 7.23 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 1.59 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Links
  • jam1garner/network-reader
    1 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • jam1garner

network-reader

A client/server protocol for using io::Read and io::Seek over a network

Server example:

use network_reader::Networked;

Networked::new_buffered(File::open("my_file.txt").unwrap(), ("127.0.0.1", 4000))
    .unwrap()
    .listen()
    .unwrap();

Client example:

use network_reader::NetworkReader;

let mut reader = NetworkReader::new(("127.0.0.1", 4000)).unwrap();

// Read 4 bytes from Reader provided over the network
let mut buf = [0u8; 4];
reader.read_exact(&mut buf).unwrap();

If the two above samples were used together, the client would read the first 4 bytes from file "my_file.txt".