Skip to main content

Client

Struct Client 

Source
pub struct Client { /* private fields */ }
Expand description

A blocking HDFS client.

Implementations§

Source§

impl Client

Source

pub fn get_file_info(&self, path: &str) -> Result<FileStatus>

Retrieve the file status for the file at path.

Source

pub fn list_status( &self, path: &str, recursive: bool, ) -> Result<Vec<FileStatus>>

Retrieve all file statuses under path.

Source

pub fn list_status_iter( &self, path: &str, recursive: bool, ) -> ListStatusIterator

Retrieve a blocking iterator of all files in directories located at path.

Source

pub fn read(&self, path: &str) -> Result<FileReader>

Opens a file reader for the file at path.

Source

pub fn create( &self, src: &str, write_options: impl AsRef<WriteOptions>, ) -> Result<FileWriter>

Opens a new file for writing.

Source

pub fn append(&self, src: &str) -> Result<FileWriter>

Opens an existing file for appending.

Source

pub fn mkdirs( &self, path: &str, permission: u32, create_parent: bool, ) -> Result<()>

Create a new directory at path with the given permission.

Source

pub fn rename(&self, src: &str, dst: &str, overwrite: bool) -> Result<()>

Rename src to dst.

Source

pub fn delete(&self, path: &str, recursive: bool) -> Result<bool>

Delete the file or directory at path.

Source

pub fn trash(&self, path: &str) -> Result<Option<String>>

Move a file or directory at path into the user’s trash.

Source

pub fn set_times(&self, path: &str, mtime: u64, atime: u64) -> Result<()>

Set modified and access times for a file.

Source

pub fn set_owner( &self, path: &str, owner: Option<&str>, group: Option<&str>, ) -> Result<()>

Optionally set the owner and group for a file.

Source

pub fn set_permission(&self, path: &str, permission: u32) -> Result<()>

Set permissions for a file.

Source

pub fn set_replication(&self, path: &str, replication: u32) -> Result<bool>

Set replication for a file.

Source

pub fn get_content_summary(&self, path: &str) -> Result<ContentSummary>

Get a content summary for a file or directory rooted at path.

Source

pub fn modify_acl_entries( &self, path: &str, acl_spec: Vec<AclEntry>, ) -> Result<()>

Update ACL entries for file or directory at path.

Source

pub fn remove_acl_entries( &self, path: &str, acl_spec: Vec<AclEntry>, ) -> Result<()>

Remove specific ACL entries for file or directory at path.

Source

pub fn remove_default_acl(&self, path: &str) -> Result<()>

Remove all default ACL entries for file or directory at path.

Source

pub fn remove_acl(&self, path: &str) -> Result<()>

Remove all ACL entries for file or directory at path.

Source

pub fn set_acl(&self, path: &str, acl_spec: Vec<AclEntry>) -> Result<()>

Override ACL entries for file or directory at path.

Source

pub fn get_acl_status(&self, path: &str) -> Result<AclStatus>

Get ACL status for the file or directory at path.

Source

pub fn glob_status(&self, pattern: &str) -> Result<Vec<FileStatus>>

Get all file statuses matching the glob pattern.

Trait Implementations§

Source§

impl Clone for Client

Source§

fn clone(&self) -> Client

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Client

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for Client

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> ErasedDestructor for T
where T: 'static,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.