alluxio-rs

Crates.ioalluxio-rs
lib.rsalluxio-rs
version0.1.1
sourcesrc
created_at2023-11-09 10:43:58.429857
updated_at2023-11-09 11:04:24.277992
descriptionrust alluxio rest api client
homepage
repositoryhttps://github.com/hoslo/alluxio-rs
max_upload_size
id1030013
size53,833
(hoslo)

documentation

README

alluxio-rs

Rust Crate for the Alluxio File System API

Usage/Examples

use std::time::Duration;

use alluxio_rs::{client, option};
use tokio::io::BufReader;

#[tokio::main]
async fn main() {
    let path = "/test_path";
    let c = client::Client::new("localhost".to_string(), 39999, Duration::from_secs(10)).unwrap();

    let r = c.exists(path, option::Exists).await.unwrap();
    let s = "123";
    let d = s.as_bytes();
    let buf = BufReader::new(d);
    let id = c
        .create_file(path, option::CreateFile::default())
        .await
        .unwrap();
    c.write(id, BufReader::new(buf)).await.unwrap();
    c.close(id).await.unwrap();
    println!("{} {}", r, id);
}

Acknowledgements

Commit count: 11

cargo fmt