Struct hdfs::HdfsFile
[−]
[src]
pub struct HdfsFile<'a> { // some fields omitted }
open hdfs file
Methods
impl<'a> HdfsFile<'a>
fn available(&self) -> Result<bool, HdfsErr>
fn close(&self) -> Result<bool, HdfsErr>
Close the opened file
fn flush(&self) -> bool
Flush the data.
fn hflush(&self) -> bool
Flush out the data in client's user buffer. After the return of this call, new readers will see the data.
fn hsync(&self) -> bool
Similar to posix fsync, Flush out the data in client's user buffer. all the way to the disk device (but the disk may have it in its cache).
fn is_readable(&self) -> bool
Determine if a file is open for read.
fn is_writable(&self) -> bool
Determine if a file is open for write.
fn path(&'a self) -> &'a str
Return a file path
fn pos(&self) -> Result<u64, HdfsErr>
Get the current offset in the file, in bytes.
fn read(&self, buf: &mut [u8]) -> Result<i32, HdfsErr>
Read data from an open file.
fn read_with_pos(&self, pos: i64, buf: &mut [u8]) -> Result<i32, HdfsErr>
Positional read of data from an open file.
fn read_zc(&'a self, opts: &RzOptions, max_len: i32) -> Result<RzBuffer<'a>, HdfsErr>
Perform a byte buffer read. If possible, this will be a zero-copy (mmap) read.
fn seek(&self, offset: u64) -> bool
Seek to given offset in file.
fn write(&self, buf: &[u8]) -> Result<i32, HdfsErr>
Write data into an open file.