pub struct FtpClient { /* private fields */ }Expand description
FTP/FTPS client using suppaftp with async support.
Implementations§
Source§impl FtpClient
impl FtpClient
Sourcepub async fn connect(config: &FtpConfig) -> Result<Self>
pub async fn connect(config: &FtpConfig) -> Result<Self>
Connect to an FTP server, authenticate, and switch to binary transfer mode.
pub async fn disconnect(&mut self) -> Result<()>
Sourcepub async fn list_dir(&mut self, path: &str) -> Result<Vec<FileEntry>>
pub async fn list_dir(&mut self, path: &str) -> Result<Vec<FileEntry>>
List directory contents at path.
Sourcepub async fn download_file(
&mut self,
remote_path: &str,
local_path: &str,
) -> Result<u64>
pub async fn download_file( &mut self, remote_path: &str, local_path: &str, ) -> Result<u64>
Download a remote file to a local path. Streams in 32 KiB chunks — never buffers the entire file in memory. Returns bytes downloaded.
Sourcepub async fn upload_file(
&mut self,
local_path: &str,
remote_path: &str,
) -> Result<u64>
pub async fn upload_file( &mut self, local_path: &str, remote_path: &str, ) -> Result<u64>
Upload a local file to a remote path. Streams in 32 KiB chunks — never buffers the entire file in memory. Returns bytes uploaded.
Sourcepub async fn create_dir(&mut self, path: &str) -> Result<()>
pub async fn create_dir(&mut self, path: &str) -> Result<()>
Create a directory on the remote server.
Sourcepub async fn rename(&mut self, old_path: &str, new_path: &str) -> Result<()>
pub async fn rename(&mut self, old_path: &str, new_path: &str) -> Result<()>
Rename a file or directory.
Sourcepub async fn delete_file(&mut self, path: &str) -> Result<()>
pub async fn delete_file(&mut self, path: &str) -> Result<()>
Delete a file on the remote server.
Sourcepub async fn delete_dir(&mut self, path: &str) -> Result<()>
pub async fn delete_dir(&mut self, path: &str) -> Result<()>
Delete a directory on the remote server.
Auto Trait Implementations§
impl Freeze for FtpClient
impl !RefUnwindSafe for FtpClient
impl Send for FtpClient
impl Sync for FtpClient
impl Unpin for FtpClient
impl UnsafeUnpin for FtpClient
impl !UnwindSafe for FtpClient
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