[−][src]Struct termscp::filetransfer::ftp_transfer::FtpFileTransfer
FtpFileTransfer
Ftp file transfer struct
Implementations
impl FtpFileTransfer
[src]
pub fn new(ftps: bool) -> FtpFileTransfer
[src]
new
Instantiates a new FtpFileTransfer
Trait Implementations
impl FileTransfer for FtpFileTransfer
[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
pub fn remove(&mut self, fsentry: &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 FtpFileTransfer
[src]
impl Send for FtpFileTransfer
[src]
impl Sync for FtpFileTransfer
[src]
impl Unpin for FtpFileTransfer
[src]
impl UnwindSafe for FtpFileTransfer
[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>,