Struct wezterm_ssh::Sftp
source · [−]pub struct Sftp { /* private fields */ }
Expand description
Represents an open sftp channel for performing filesystem operations
Implementations
pub async fn open_with_mode<T, E>(
&self,
filename: T,
opts: OpenOptions
) -> SftpChannelResult<File> where
T: TryInto<Utf8PathBuf, Error = E>,
E: Into<Box<dyn Error + Send + Sync>>,
pub async fn open_with_mode<T, E>(
&self,
filename: T,
opts: OpenOptions
) -> SftpChannelResult<File> where
T: TryInto<Utf8PathBuf, Error = E>,
E: Into<Box<dyn Error + Send + Sync>>,
Open a handle to a file.
pub async fn open<T, E>(&self, filename: T) -> SftpChannelResult<File> where
T: TryInto<Utf8PathBuf, Error = E>,
E: Into<Box<dyn Error + Send + Sync>>,
pub async fn open<T, E>(&self, filename: T) -> SftpChannelResult<File> where
T: TryInto<Utf8PathBuf, Error = E>,
E: Into<Box<dyn Error + Send + Sync>>,
Helper to open a file in the Read
mode.
pub async fn create<T, E>(&self, filename: T) -> SftpChannelResult<File> where
T: TryInto<Utf8PathBuf, Error = E>,
E: Into<Box<dyn Error + Send + Sync>>,
pub async fn create<T, E>(&self, filename: T) -> SftpChannelResult<File> where
T: TryInto<Utf8PathBuf, Error = E>,
E: Into<Box<dyn Error + Send + Sync>>,
Helper to create a file in write-only mode with truncation.
pub async fn open_dir<T, E>(&self, filename: T) -> SftpChannelResult<Dir> where
T: TryInto<Utf8PathBuf, Error = E>,
E: Into<Box<dyn Error + Send + Sync>>,
pub async fn open_dir<T, E>(&self, filename: T) -> SftpChannelResult<Dir> where
T: TryInto<Utf8PathBuf, Error = E>,
E: Into<Box<dyn Error + Send + Sync>>,
Helper to open a directory for reading its contents.
pub async fn read_dir<T, E>(
&self,
filename: T
) -> SftpChannelResult<Vec<(Utf8PathBuf, Metadata)>> where
T: TryInto<Utf8PathBuf, Error = E>,
E: Into<Box<dyn Error + Send + Sync>>,
pub async fn read_dir<T, E>(
&self,
filename: T
) -> SftpChannelResult<Vec<(Utf8PathBuf, Metadata)>> where
T: TryInto<Utf8PathBuf, Error = E>,
E: Into<Box<dyn Error + Send + Sync>>,
Convenience function to read the files in a directory.
The returned paths are all joined with dirname when returned, and the paths . and .. are filtered out of the returned list.
pub async fn create_dir<T, E>(
&self,
filename: T,
mode: i32
) -> SftpChannelResult<()> where
T: TryInto<Utf8PathBuf, Error = E>,
E: Into<Box<dyn Error + Send + Sync>>,
pub async fn create_dir<T, E>(
&self,
filename: T,
mode: i32
) -> SftpChannelResult<()> where
T: TryInto<Utf8PathBuf, Error = E>,
E: Into<Box<dyn Error + Send + Sync>>,
Create a directory on the remote filesystem.
pub async fn remove_dir<T, E>(&self, filename: T) -> SftpChannelResult<()> where
T: TryInto<Utf8PathBuf, Error = E>,
E: Into<Box<dyn Error + Send + Sync>>,
pub async fn remove_dir<T, E>(&self, filename: T) -> SftpChannelResult<()> where
T: TryInto<Utf8PathBuf, Error = E>,
E: Into<Box<dyn Error + Send + Sync>>,
Remove a directory from the remote filesystem.
Get the metadata for a file, performed by stat(2).
pub async fn symlink_metadata<T, E>(
&self,
filename: T
) -> SftpChannelResult<Metadata> where
T: TryInto<Utf8PathBuf, Error = E>,
E: Into<Box<dyn Error + Send + Sync>>,
pub async fn symlink_metadata<T, E>(
&self,
filename: T
) -> SftpChannelResult<Metadata> where
T: TryInto<Utf8PathBuf, Error = E>,
E: Into<Box<dyn Error + Send + Sync>>,
Get the metadata for a file, performed by lstat(2).
pub async fn set_metadata<T, E>(
&self,
filename: T,
metadata: Metadata
) -> SftpChannelResult<()> where
T: TryInto<Utf8PathBuf, Error = E>,
E: Into<Box<dyn Error + Send + Sync>>,
pub async fn set_metadata<T, E>(
&self,
filename: T,
metadata: Metadata
) -> SftpChannelResult<()> where
T: TryInto<Utf8PathBuf, Error = E>,
E: Into<Box<dyn Error + Send + Sync>>,
Set the metadata for a file.
Create symlink at target
pointing at path
.
pub async fn read_link<T, E>(&self, path: T) -> SftpChannelResult<Utf8PathBuf> where
T: TryInto<Utf8PathBuf, Error = E>,
E: Into<Box<dyn Error + Send + Sync>>,
pub async fn read_link<T, E>(&self, path: T) -> SftpChannelResult<Utf8PathBuf> where
T: TryInto<Utf8PathBuf, Error = E>,
E: Into<Box<dyn Error + Send + Sync>>,
Read a symlink at path
.
pub async fn canonicalize<T, E>(
&self,
path: T
) -> SftpChannelResult<Utf8PathBuf> where
T: TryInto<Utf8PathBuf, Error = E>,
E: Into<Box<dyn Error + Send + Sync>>,
pub async fn canonicalize<T, E>(
&self,
path: T
) -> SftpChannelResult<Utf8PathBuf> where
T: TryInto<Utf8PathBuf, Error = E>,
E: Into<Box<dyn Error + Send + Sync>>,
Resolve the real path for path
.
pub async fn rename<T1, T2, E1, E2>(
&self,
src: T1,
dst: T2,
opts: RenameOptions
) -> SftpChannelResult<()> where
T1: TryInto<Utf8PathBuf, Error = E1>,
T2: TryInto<Utf8PathBuf, Error = E2>,
E1: Into<Box<dyn Error + Send + Sync>>,
E2: Into<Box<dyn Error + Send + Sync>>,
pub async fn rename<T1, T2, E1, E2>(
&self,
src: T1,
dst: T2,
opts: RenameOptions
) -> SftpChannelResult<()> where
T1: TryInto<Utf8PathBuf, Error = E1>,
T2: TryInto<Utf8PathBuf, Error = E2>,
E1: Into<Box<dyn Error + Send + Sync>>,
E2: Into<Box<dyn Error + Send + Sync>>,
Rename the filesystem object on the remote filesystem.
pub async fn remove_file<T, E>(&self, file: T) -> SftpChannelResult<()> where
T: TryInto<Utf8PathBuf, Error = E>,
E: Into<Box<dyn Error + Send + Sync>>,
pub async fn remove_file<T, E>(&self, file: T) -> SftpChannelResult<()> where
T: TryInto<Utf8PathBuf, Error = E>,
E: Into<Box<dyn Error + Send + Sync>>,
Remove a file on the remote filesystem.
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for Sftp
impl UnwindSafe for Sftp
Blanket Implementations
Mutably borrows from an owned value. Read more