Crate hdrs

source ·
Expand description

hdrs is a HDFS Native Client in Rust based on hdfs-sys.


use std::io::{Read, Write};

use hdrs::Client;

let fs = Client::connect("default")?;

let mut f = fs.open_file().write(true).create(true).open("/tmp/hello.txt")?;
let n = f.write("Hello, World!".as_bytes())?;

let mut f = fs.open_file().read(true).open("/tmp/hello.txt")?;
let mut buf = vec![0; 1024];
let n = buf)?;

let _ = fs.remove_file("/tmp/hello.txt")?;



Async version of file.
Client holds the underlying connection to hdfs clusters.
File will hold the underlying pointer to hdfsFile.
Metadata of a path.
Options and flags which can be used to configure how a file is opened.
Readdir is an Iterator of metadata, returned by read_dir