nfs 0.1.0

A userspace NFSv3 and NFSv4 client library.
Documentation
  • Coverage
  • 39.35%
    458 out of 1164 items documented3 out of 177 items with examples
  • Size
  • Source code size: 757.71 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 56.95 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 1m 1s Average build duration of successful builds.
  • all releases: 1m 1s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • lvillis

nfs

Userspace Rust NFS client library.

Use NFS exports without mounting them into the local filesystem.

Status

Under active development. Not recommended for production use yet.

Protocols

  • NFSv3 over ONC RPC/TCP
  • NFSv4.2 over ONC RPC/TCP
  • Blocking clients by default
  • Tokio clients with the tokio feature

Install

[dependencies]
nfs = "0.1"
# Enable async clients
nfs = { version = "0.1", features = ["tokio"] }
# Protocol types only
nfs = { version = "0.1", default-features = false, features = ["protocol"] }

Example

let mut client = nfs::v3::blocking::Client::connect("127.0.0.1:/export")?;
client.write("/hello.txt", b"hello")?;
let data = client.read("/hello.txt")?;
# Ok::<(), nfs::Error>(())
let mut client = nfs::v4::blocking::Client::connect("127.0.0.1")?;
client.write("/export/hello.txt", b"hello")?;
let data = client.read("/export/hello.txt")?;
client.shutdown()?;
# Ok::<(), nfs::Error>(())

Notes

  • timeout(...), retry_policy(...), and reconnect() are available on high-level clients.
  • AuthSys::current() sends uid, primary gid, and up to 16 supplementary groups.
  • Common errors expose helpers such as is_not_found(), is_retryable(), and is_permission_denied().

Not Implemented

  • RPCSEC_GSS/Kerberos
  • pNFS
  • NFSv4 callbacks/delegations
  • NLM file locking
  • UDP transport