Crates.io | nine |
lib.rs | nine |
version | 0.5.0 |
source | src |
created_at | 2016-07-04 05:08:15.311886 |
updated_at | 2019-11-08 00:08:03.278654 |
description | The 9p protocol as a serde format and message types. |
homepage | |
repository | https://github.com/KevinMGranger/nine |
max_upload_size | |
id | 5585 |
size | 85,725 |
The 9p protocol as a serde format and message types.
This crate contains structs representing the various types of messages in the 9p2000 protocol (with other versions coming soon), as well as a serializer and deserializer for the wire format for those messages.
There is not an included server implementation or abstraction.
The purpose of this design is to allow for easy extensibility and experimentation with the protocol.
This library is in its early stages of development, and thus may have large, backwards-incompatible changes that occur. User discretion is adviced.
To connect to a 9p server and start version negotiation:
use std::io::prelude::*;
use std::net::TcpStream;
use nine::ser::*;
use nine::de::*;
use nine::p2000::*;
let connection = TcpStream::connect("127.0.0.1").unwrap();
let version = Tversion { tag: NOTAG, msize: u32::max_value(), version: "9p2000".into() };
let serialized_message: Vec<u8> = into_bytes(&version).unwrap();
connection.write_all(&serialized_message).unwrap();
nine
can also be used as a simple one-shot 9p client, a-la plan9port's 9p
command.
Currently only non-authed explicitly-attached read to a unix socket is implemented.
# set up a server to listen at /tmp/9ptest, then:
$ nine -a /tmp/9ptest read /foo
bar
Casey Rodarmor for collaborating on the initial design.
The countless others in the rust community that have answered my questions.