pub struct DbfsClient { /* private fields */ }
Expand description
DBFS Client
Implementations§
Source§impl DbfsClient
impl DbfsClient
Sourcepub fn new(url_base: &str, token: &str) -> Self
pub fn new(url_base: &str, token: &str) -> Self
Create New DBFS Client
@param url_base: the base part of the DBFS endpoint, e.g. “https://adb-xxx.azuredatabricks.net” @param token: The Databricks API token
Sourcepub fn read(&self, path: &str) -> Result<DbfsReadStream>
pub fn read(&self, path: &str) -> Result<DbfsReadStream>
Read DBFS file, returns AsyncRead + AsyncBufRead
Sourcepub async fn write_file<T>(&self, path: &str, data: T) -> Result<()>
pub async fn write_file<T>(&self, path: &str, data: T) -> Result<()>
Write data to file, the existing content will be overwritten
Sourcepub async fn upload_file<T>(
&self,
local_path: T,
remote_path: &str,
) -> Result<String>
pub async fn upload_file<T>( &self, local_path: T, remote_path: &str, ) -> Result<String>
Upload a local file to DBFS
Sourcepub async fn download_file<T>(
&self,
remote_path: &str,
local_path: T,
) -> Result<PathBuf>
pub async fn download_file<T>( &self, remote_path: &str, local_path: T, ) -> Result<PathBuf>
Download DBFS file to local path
Sourcepub async fn get_file_status(&self, path: &str) -> Result<FileStatus>
pub async fn get_file_status(&self, path: &str) -> Result<FileStatus>
Get DBFS file status
Sourcepub async fn delete_file(&self, path: &str) -> Result<()>
pub async fn delete_file(&self, path: &str) -> Result<()>
Delete DBFS file
Trait Implementations§
Source§impl Clone for DbfsClient
impl Clone for DbfsClient
Source§fn clone(&self) -> DbfsClient
fn clone(&self) -> DbfsClient
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreAuto Trait Implementations§
impl Freeze for DbfsClient
impl !RefUnwindSafe for DbfsClient
impl Send for DbfsClient
impl Sync for DbfsClient
impl Unpin for DbfsClient
impl !UnwindSafe for DbfsClient
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