nfs_v4/lib.rs
1//! NFS version 4.0 -- [RFC 7530].
2//!
3//! NFSv4 is a different shape from v2 and v3. Rather than one RPC per
4//! operation, the client batches operations into a single `COMPOUND` call that
5//! the server executes in order against a "current file handle" the operations
6//! mutate as they go, so `PUTROOTFH; LOOKUP "etc"; GETFH` is one round trip.
7//! MOUNT is gone: the server exports a single pseudo-filesystem tree reached
8//! from `PUTROOTFH`.
9//!
10//! # Scope
11//!
12//! Both stateless operations (LOOKUP, GETATTR, READDIR, anonymous READ) and
13//! stateful operations (SETCLIENTID, OPEN, CLOSE, stateid-bearing READ/WRITE,
14//! RENEW) are implemented for NFSv4.0. The [`session`] module tracks the
15//! (clientid, verifier) pair negotiated via SETCLIENTID + SETCLIENTID_CONFIRM,
16//! and the [`state`] module tracks per-file open and lock stateids.
17//!
18//! The v4.1 session machinery of [RFC 8881] (CREATE_SESSION, SEQUENCE,
19//! DESTROY_SESSION) is not yet implemented.
20//!
21//! [RFC 7530]: https://www.rfc-editor.org/rfc/rfc7530
22//! [RFC 8881]: https://www.rfc-editor.org/rfc/rfc8881
23
24pub mod client;
25pub mod session;
26pub mod state;
27pub mod wire;
28
29pub use client::{Nfs4Client, Nfs4Error};
30pub use session::Nfs4Session;
31pub use state::{LockRange, LockState, OpenState};
32pub use wire::NfsImplId4;
33pub use wire::{ArgOp, AttrRequest, CompoundArgs, CompoundBuilder, CompoundRes, DirEntry4, Fattr4Decoded, NFS4_PROC_COMPOUND, NFS4_PROGRAM as PROGRAM, NFS4_VERSION as VERSION, Nfs4DirEntry, Nfs4FileInfo, Nfs4FileType, Nfs4Status, ResOp, ResOpData, SecInfoEntry};
34pub use wire::{FATTR4_SEC_LABEL, SecLabel4};
35// Phase 1: enums and constants.
36pub use wire::{CreateMode4, LockType4, NFS4_FHSIZE, NFS4_OPAQUE_LIMIT, NFS4_OTHER_SIZE, NFS4_VERIFIER_SIZE, OpenClaimType4, OpenDelegationType4, OpenType4, StableHow4};
37// Phase 2a: compound types.
38pub use wire::{ChangeInfo4, LockOwner4, NfsAce4, NfsFtype4, OpenOwner4, Stateid4};
39// Phase 2b: discriminated unions and fattr4 container.
40pub use wire::{CreateType4, Fattr4, Locker4, OpenClaim4, OpenFlag4};
41// Phase 3b: response-only types.
42pub use wire::{OpenDelegation4, SpaceLimit4};