fernfs/
lib.rs

1//! FernFS - A Network File System (NFS) server implementation in Rust
2//!
3//! This library provides a complete implementation of the NFS version 3 protocol
4//! as defined in RFC 1813, allowing any Rust application to expose file systems
5//! over the network to NFS clients.
6//!
7//! ## Supported Features
8//!
9//! - Full `NFSv3` protocol implementation (all 21 procedures defined in RFC 1813)
10//! - `MOUNT` protocol for filesystem exports
11//! - `PORTMAP` protocol for service discovery
12//! - `TCP` and `UDP` transport protocols
13//! - Asynchronous operation with Tokio runtime
14//! - Virtual File System abstraction for implementing custom backends
15//!
16//! ## Main Components
17//!
18//! - `vfs`: The Virtual File System API that must be implemented to create a custom NFS-exportable
19//!   file system. This abstracts the underlying storage from the NFS protocol details.
20//!
21//! - `tcp`: TCP-based server implementation that handles client connections and dispatches
22//!   NFS protocol requests to the appropriate handlers.
23//!
24//! - `protocol`: Internal module that implements the `NFS`, `MOUNT`, and `PORTMAP` protocols,
25//!   including `XDR` (External Data Representation) encoding/decoding.
26//!
27//! - `fs_util`: Utility functions for working with file systems.
28//!
29//! ## Standards Compliance
30//!
31//! This implementation follows these RFCs:
32//! - RFC 1813: NFS Version 3 Protocol Specification
33//! - RFC 5531: RPC: Remote Procedure Call Protocol Specification Version 2 (obsoletes RFC 1831)
34//! - RFC 1832: XDR: External Data Representation Standard (obsoletes RFC 1014)
35//! - RFC 1833: Binding Protocols for ONC RPC Version 2
36//!
37//! ## Usage
38//!
39//! To create an NFS server, implement the `NFSFileSystem` trait and use the `NFSTcpListener`
40//! to expose it over the network.
41
42pub mod protocol;
43mod write_counter;
44
45#[cfg(not(target_os = "windows"))]
46pub mod fs_util;
47
48pub mod tcp;
49pub mod vfs;
50
51pub use protocol::xdr;