[−][src]Struct termscp::filetransfer::scp_transfer::ScpFileTransfer
ScpFileTransfer
SCP file transfer structure
Implementations
impl ScpFileTransfer
[src]
pub fn new(key_storage: SshKeyStorage) -> ScpFileTransfer
[src]
new
Instantiates a new ScpFileTransfer
Trait Implementations
impl FileTransfer for ScpFileTransfer
[src]
pub fn connect(
&mut self,
address: String,
port: u16,
username: Option<String>,
password: Option<String>
) -> Result<Option<String>, FileTransferError>
[src]
&mut self,
address: String,
port: u16,
username: Option<String>,
password: Option<String>
) -> Result<Option<String>, FileTransferError>
connect
Connect to the remote server
pub fn disconnect(&mut self) -> Result<(), FileTransferError>
[src]
disconnect
Disconnect from the remote server
pub fn is_connected(&self) -> bool
[src]
is_connected
Indicates whether the client is connected to remote
pub fn pwd(&mut self) -> Result<PathBuf, FileTransferError>
[src]
pwd
Print working directory
pub fn change_dir(&mut self, dir: &Path) -> Result<PathBuf, FileTransferError>
[src]
change_dir
Change working directory
pub fn copy(
&mut self,
src: &FsEntry,
dst: &Path
) -> Result<(), FileTransferError>
[src]
&mut self,
src: &FsEntry,
dst: &Path
) -> Result<(), FileTransferError>
copy
Copy file to destination
pub fn list_dir(
&mut self,
path: &Path
) -> Result<Vec<FsEntry>, FileTransferError>
[src]
&mut self,
path: &Path
) -> Result<Vec<FsEntry>, FileTransferError>
list_dir
List directory entries
pub fn mkdir(&mut self, dir: &Path) -> Result<(), FileTransferError>
[src]
mkdir
Make directory You must return error in case the directory already exists
pub fn remove(&mut self, file: &FsEntry) -> Result<(), FileTransferError>
[src]
remove
Remove a file or a directory
pub fn rename(
&mut self,
file: &FsEntry,
dst: &Path
) -> Result<(), FileTransferError>
[src]
&mut self,
file: &FsEntry,
dst: &Path
) -> Result<(), FileTransferError>
rename
Rename file or a directory
pub fn stat(&mut self, path: &Path) -> Result<FsEntry, FileTransferError>
[src]
stat
Stat file and return FsEntry
pub fn send_file(
&mut self,
local: &FsFile,
file_name: &Path
) -> Result<Box<dyn Write>, FileTransferError>
[src]
&mut self,
local: &FsFile,
file_name: &Path
) -> Result<Box<dyn Write>, FileTransferError>
send_file
Send file to remote File name is referred to the name of the file as it will be saved Data contains the file data Returns file and its size
pub fn recv_file(
&mut self,
file: &FsFile
) -> Result<Box<dyn Read>, FileTransferError>
[src]
&mut self,
file: &FsFile
) -> Result<Box<dyn Read>, FileTransferError>
recv_file
Receive file from remote with provided name Returns file and its size
pub fn on_sent(
&mut self,
_writable: Box<dyn Write>
) -> Result<(), FileTransferError>
[src]
&mut self,
_writable: Box<dyn Write>
) -> Result<(), FileTransferError>
on_sent
Finalize send method.
This method must be implemented only if necessary; in case you don't need it, just return Ok(())
The purpose of this method is to finalize the connection with the peer when writing data.
This is necessary for some protocols such as FTP.
You must call this method each time you want to finalize the write of the remote file.
pub fn on_recv(
&mut self,
_readable: Box<dyn Read>
) -> Result<(), FileTransferError>
[src]
&mut self,
_readable: Box<dyn Read>
) -> Result<(), FileTransferError>
on_recv
Finalize recv method.
This method must be implemented only if necessary; in case you don't need it, just return Ok(())
The purpose of this method is to finalize the connection with the peer when reading data.
This mighe be necessary for some protocols.
You must call this method each time you want to finalize the read of the remote file.
Auto Trait Implementations
impl !RefUnwindSafe for ScpFileTransfer
[src]
impl Send for ScpFileTransfer
[src]
impl Sync for ScpFileTransfer
[src]
impl Unpin for ScpFileTransfer
[src]
impl !UnwindSafe for ScpFileTransfer
[src]
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,