5 releases (3 breaking)

Uses new Rust 2024

new 0.4.0 Apr 14, 2025
0.3.0 Mar 23, 2025
0.2.0 Mar 2, 2025
0.1.1 Feb 23, 2025
0.1.0 Feb 22, 2025

#643 in Filesystem

Download history 221/week @ 2025-02-18 171/week @ 2025-02-25 46/week @ 2025-03-04 3/week @ 2025-03-11 103/week @ 2025-03-18 26/week @ 2025-03-25 11/week @ 2025-04-01 71/week @ 2025-04-08

213 downloads per month

Unlicense

98KB
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.

Examples

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 ip = "127.0.0.1".to_string();
    let mount_path = "/".to_string();

    let mut connection = Nfs3ConnectionBuilder::new(TokioConnector, ip, mount_path)
        .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(())
}

Dependencies

~4–13MB
~154K SLoC