Expand description
Userspace NFS client library.
This crate talks to NFS servers directly from a Rust process. It is meant for applications that want NFS as an object/file storage backend without mounting the export into the local filesystem.
The default feature set enables blocking clients:
let mut client = nfs::v3::blocking::Client::connect("127.0.0.1:/export")?;
client.write("/hello.txt", b"hello")?;
let bytes = client.read("/hello.txt")?;
assert_eq!(bytes, b"hello");let mut client = nfs::v4::blocking::Client::connect("127.0.0.1")?;
client.write("/export/hello.txt", b"hello")?;
let bytes = client.read("/export/hello.txt")?;
assert_eq!(bytes, b"hello");
client.shutdown()?;§Feature flags
blocking: Enables synchronous clients. This is enabled by default.tokio: Enables asynchronous clients backed by Tokio.protocol: Exposes low-level XDR and protocol wire types for tests, custom integrations, and protocol tooling.
§API layers
Most applications should use v3::blocking::Client,
v4::blocking::Client, or the corresponding Tokio clients. The raw
protocol modules are intentionally kept behind the protocol feature so
high-level users do not depend on unstable wire-level details.
Modules§
Structs§
- AuthSys
- AUTH_SYS credential used for ONC RPC calls.
- Retry
Policy - Exponential backoff policy for retryable RPC/NFS responses.
Enums§
- Error
- Error type for transport, XDR, RPC, and NFS protocol failures.
Constants§
- AUTH_
SYS_ MAX_ GROUPS - Maximum number of auxiliary groups carried by AUTH_SYS credentials.
Type Aliases§
- Result
- Result type used by this crate.