Struct openssh_sftp_client::fs::Fs
source · [−]pub struct Fs<'s> { /* private fields */ }
Expand description
A struct used to perform operations on remote filesystem.
Implementations
sourceimpl<'s> Fs<'s>
impl<'s> Fs<'s>
sourcepub async fn open_dir(
&mut self,
path: impl AsRef<Path>
) -> Result<Dir<'_>, Error>
pub async fn open_dir(
&mut self,
path: impl AsRef<Path>
) -> Result<Dir<'_>, Error>
Open a remote dir
sourcepub fn dir_builder(&mut self) -> DirBuilder<'_, 's>
pub fn dir_builder(&mut self) -> DirBuilder<'_, 's>
Create a directory builder.
sourcepub async fn create_dir(&mut self, path: impl AsRef<Path>) -> Result<(), Error>
pub async fn create_dir(&mut self, path: impl AsRef<Path>) -> Result<(), Error>
Creates a new, empty directory at the provided path.
sourcepub async fn remove_dir(&mut self, path: impl AsRef<Path>) -> Result<(), Error>
pub async fn remove_dir(&mut self, path: impl AsRef<Path>) -> Result<(), Error>
Removes an existing, empty directory.
sourcepub async fn remove_file(&mut self, path: impl AsRef<Path>) -> Result<(), Error>
pub async fn remove_file(&mut self, path: impl AsRef<Path>) -> Result<(), Error>
Removes a file from remote filesystem.
sourcepub async fn canonicalize(
&mut self,
path: impl AsRef<Path>
) -> Result<PathBuf, Error>
pub async fn canonicalize(
&mut self,
path: impl AsRef<Path>
) -> Result<PathBuf, Error>
Returns the canonical, absolute form of a path with all intermediate components normalized and symbolic links resolved.
sourcepub async fn hard_link(
&mut self,
src: impl AsRef<Path>,
dst: impl AsRef<Path>
) -> Result<(), Error>
pub async fn hard_link(
&mut self,
src: impl AsRef<Path>,
dst: impl AsRef<Path>
) -> Result<(), Error>
Creates a new hard link on the remote filesystem.
sourcepub async fn symlink(
&mut self,
src: impl AsRef<Path>,
dst: impl AsRef<Path>
) -> Result<(), Error>
pub async fn symlink(
&mut self,
src: impl AsRef<Path>,
dst: impl AsRef<Path>
) -> Result<(), Error>
Creates a new symlink on the remote filesystem.
sourcepub async fn rename(
&mut self,
from: impl AsRef<Path>,
to: impl AsRef<Path>
) -> Result<(), Error>
pub async fn rename(
&mut self,
from: impl AsRef<Path>,
to: impl AsRef<Path>
) -> Result<(), Error>
Renames a file or directory to a new name, replacing the original file if to already exists.
This will not work if the new name is on a different mount point.
sourcepub async fn read_link(
&mut self,
path: impl AsRef<Path>
) -> Result<PathBuf, Error>
pub async fn read_link(
&mut self,
path: impl AsRef<Path>
) -> Result<PathBuf, Error>
Reads a symbolic link, returning the file that the link points to.
sourcepub async fn set_metadata(
&mut self,
path: impl AsRef<Path>,
metadata: MetaData
) -> Result<(), Error>
pub async fn set_metadata(
&mut self,
path: impl AsRef<Path>,
metadata: MetaData
) -> Result<(), Error>
Change the metadata of a file or a directory.
sourcepub async fn set_permissions(
&mut self,
path: impl AsRef<Path>,
perm: Permissions
) -> Result<(), Error>
pub async fn set_permissions(
&mut self,
path: impl AsRef<Path>,
perm: Permissions
) -> Result<(), Error>
Changes the permissions found on a file or a directory.
sourcepub async fn metadata(
&mut self,
path: impl AsRef<Path>
) -> Result<MetaData, Error>
pub async fn metadata(
&mut self,
path: impl AsRef<Path>
) -> Result<MetaData, Error>
Given a path, queries the file system to get information about a file, directory, etc.
sourcepub async fn symlink_metadata(
&mut self,
path: impl AsRef<Path>
) -> Result<MetaData, Error>
pub async fn symlink_metadata(
&mut self,
path: impl AsRef<Path>
) -> Result<MetaData, Error>
Queries the file system metadata for a path.
Trait Implementations
Auto Trait Implementations
impl<'s> !RefUnwindSafe for Fs<'s>
impl<'s> Send for Fs<'s>
impl<'s> Sync for Fs<'s>
impl<'s> Unpin for Fs<'s>
impl<'s> !UnwindSafe for Fs<'s>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more