pub struct StandaloneSftpClient { /* private fields */ }Expand description
Standalone SFTP client — opens an SSH connection and SFTP subsystem channel without allocating a PTY.
Implementations§
Source§impl StandaloneSftpClient
impl StandaloneSftpClient
Sourcepub async fn connect(
config: &SftpConfig,
host_keys: Arc<HostKeyStore>,
) -> Result<Self>
pub async fn connect( config: &SftpConfig, host_keys: Arc<HostKeyStore>, ) -> Result<Self>
Establish an SSH connection, authenticate, and open the SFTP subsystem.
pub async fn disconnect(&mut self) -> Result<()>
Sourcepub async fn list_dir(&self, path: &str) -> Result<Vec<RemoteFileEntry>>
pub async fn list_dir(&self, path: &str) -> Result<Vec<RemoteFileEntry>>
List directory contents at path.
Sourcepub async fn download_file(
&self,
remote_path: &str,
local_path: &str,
) -> Result<u64>
pub async fn download_file( &self, remote_path: &str, local_path: &str, ) -> Result<u64>
Download a remote file to a local path. Streams chunks — never buffers the whole file. Returns bytes downloaded.
Sourcepub async fn upload_file(
&self,
local_path: &str,
remote_path: &str,
) -> Result<u64>
pub async fn upload_file( &self, local_path: &str, remote_path: &str, ) -> Result<u64>
Upload a local file to a remote path. Streams chunks — never buffers the whole file. Returns bytes uploaded.
Sourcepub async fn create_dir(&self, path: &str) -> Result<()>
pub async fn create_dir(&self, path: &str) -> Result<()>
Create a directory on the remote server.
Sourcepub async fn rename(&self, old_path: &str, new_path: &str) -> Result<()>
pub async fn rename(&self, old_path: &str, new_path: &str) -> Result<()>
Rename a file or directory.
Sourcepub async fn delete_file(&self, path: &str) -> Result<()>
pub async fn delete_file(&self, path: &str) -> Result<()>
Delete a file on the remote server.
Sourcepub async fn delete_dir(&self, path: &str) -> Result<()>
pub async fn delete_dir(&self, path: &str) -> Result<()>
Delete a directory on the remote server.
Auto Trait Implementations§
impl Freeze for StandaloneSftpClient
impl !RefUnwindSafe for StandaloneSftpClient
impl Send for StandaloneSftpClient
impl Sync for StandaloneSftpClient
impl Unpin for StandaloneSftpClient
impl UnsafeUnpin for StandaloneSftpClient
impl !UnwindSafe for StandaloneSftpClient
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