Crates.io | alluxio-rs |
lib.rs | alluxio-rs |
version | 0.1.1 |
source | src |
created_at | 2023-11-09 10:43:58.429857 |
updated_at | 2023-11-09 11:04:24.277992 |
description | rust alluxio rest api client |
homepage | |
repository | https://github.com/hoslo/alluxio-rs |
max_upload_size | |
id | 1030013 |
size | 53,833 |
Rust Crate for the Alluxio File System API
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);
}