pub struct HDFS<S: Read + Write, D: Read + Write> { /* private fields */ }
Implementations§
Source§impl HDFS<BufStream<TcpStream>, BufStream<TcpStream>>
impl HDFS<BufStream<TcpStream>, BufStream<TcpStream>>
pub fn connect<S: ToString>( name_node: impl ToNameNodes, user: impl Into<Option<S>>, ) -> Result<Self>
pub fn connect_with(config: ClientConfig) -> Result<Self>
Source§impl<S: Read + Write, D: Read + Write> HDFS<S, D>
impl<S: Read + Write, D: Read + Write> HDFS<S, D>
pub fn new( create_ipc: impl Fn() -> Result<HRpc<S>> + 'static, connect_datanode: impl Fn(&DatanodeIdProto, IOType) -> Result<D> + 'static, ) -> Result<Self>
pub fn client_name(&self) -> &str
pub fn get_rpc(&mut self) -> &mut HRpc<S>
pub fn new_rpc(&mut self) -> Result<HRpc<S>, Error>
Sourcepub fn open(
&mut self,
path: impl AsRef<Path>,
) -> Result<FileReader<D>, HDFSError>
pub fn open( &mut self, path: impl AsRef<Path>, ) -> Result<FileReader<D>, HDFSError>
open a file
Sourcepub fn reader_options(&mut self) -> ReaderOptions
pub fn reader_options(&mut self) -> ReaderOptions
use reader option to custom file read options
Sourcepub fn create(
&mut self,
path: impl AsRef<Path>,
) -> Result<FileWriter<S, D>, HDFSError>
pub fn create( &mut self, path: impl AsRef<Path>, ) -> Result<FileWriter<S, D>, HDFSError>
create a file
Sourcepub fn append(
&mut self,
path: impl AsRef<Path>,
) -> Result<FileWriter<S, D>, HDFSError>
pub fn append( &mut self, path: impl AsRef<Path>, ) -> Result<FileWriter<S, D>, HDFSError>
open a existing file and append content to it
pub fn writer_options(&mut self) -> WriterOptions
pub fn create_dir(&mut self, path: impl AsRef<Path>) -> Result<(), HDFSError>
pub fn create_dir_all( &mut self, path: impl AsRef<Path>, ) -> Result<(), HDFSError>
Sourcepub fn read(&mut self, path: impl AsRef<Path>) -> Result<Vec<u8>, HDFSError>
pub fn read(&mut self, path: impl AsRef<Path>) -> Result<Vec<u8>, HDFSError>
read the entire contents of a file into a bytes vector.
pub fn read_dir( &mut self, path: impl AsRef<Path>, ) -> Result<Vec<HdfsFileStatusProto>, HDFSError>
pub fn remove_dir(&mut self, path: impl AsRef<Path>) -> Result<(), HDFSError>
pub fn remove_dir_all( &mut self, path: impl AsRef<Path>, ) -> Result<(), HDFSError>
pub fn remove_file(&mut self, path: impl AsRef<Path>) -> Result<(), HDFSError>
pub fn rename( &mut self, from: impl AsRef<Path>, to: impl AsRef<Path>, ) -> Result<(), HDFSError>
Auto Trait Implementations§
impl<S, D> Freeze for HDFS<S, D>where
S: Freeze,
impl<S, D> !RefUnwindSafe for HDFS<S, D>
impl<S, D> !Send for HDFS<S, D>
impl<S, D> !Sync for HDFS<S, D>
impl<S, D> Unpin for HDFS<S, D>where
S: Unpin,
impl<S, D> !UnwindSafe for HDFS<S, D>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T
in a tonic::Request