#nfs #nfs3 #smol #client #tokio #nf-sv3 #tokio-runtime

nfs3_client

Provides an implementation of NFS3 client

11 releases (7 breaking)

Uses new Rust 2024

0.8.0 Feb 14, 2026
0.7.0 Jul 26, 2025
0.6.0 Jul 20, 2025
0.3.0 Mar 23, 2025

#1264 in Filesystem

Download history 6/week @ 2026-01-04 32/week @ 2026-01-11 1/week @ 2026-01-18 80/week @ 2026-01-25 99/week @ 2026-02-01 51/week @ 2026-03-01

51 downloads per month

Unlicense

100KB
3K SLoC

nfs3_client

nfs3_client is a Rust crate that provides an asynchronous client implementation for interacting with NFSv3 servers. It includes functionality for connecting to NFS servers, performing various NFS operations, and handling the underlying RPC communication.

Features

This crate supports multiple async runtimes via feature flags:

  • tokio - Support for Tokio runtime
  • smol - Support for Smol runtime

Examples

Using with Tokio

use nfs3_client::tokio::TokioConnector;
use nfs3_client::Nfs3ConnectionBuilder;
use nfs3_types::nfs3;

#[tokio::main(flavor = "current_thread")]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    let mut connection = Nfs3ConnectionBuilder::new(TokioConnector, "127.0.0.1", "/")
        .mount()
        .await?;

    let root = connection.root_nfs_fh3();

    println!("Calling readdir");
    let readdir = connection
        .readdir(&nfs3::READDIR3args {
            dir: root,
            cookie: 0,
            cookieverf: nfs3::cookieverf3::default(),
            count: 128 * 1024 * 1024,
        })
        .await?;

    println!("{readdir:?}");

    connection.unmount().await?;

    Ok(())
}

Using with Smol

use nfs3_client::smol::SmolConnector;
use nfs3_client::Nfs3ConnectionBuilder;
use nfs3_client::nfs3_types::nfs3;

fn main() -> Result<(), Box<dyn std::error::Error>> {
    smol::block_on(async {
        let mut connection = Nfs3ConnectionBuilder::new(SmolConnector, "127.0.0.1", "/")
            .mount()
            .await?;

        let root = connection.root_nfs_fh3();

        println!("Calling readdir");
        let readdir = connection
            .readdir(&nfs3::READDIR3args {
                dir: root.clone(),
                cookie: 0,
                cookieverf: nfs3::cookieverf3::default(),
                count: 128 * 1024 * 1024,
            })
            .await?;

        println!("{readdir:?}");

        connection.unmount().await?;

        Ok(())
    })
}

Dependencies

~0.1–5.5MB
~123K SLoC