[][src]Struct termscp::filetransfer::scp_transfer::ScpFileTransfer

pub struct ScpFileTransfer { /* fields omitted */ }

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]

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]

copy

Copy file to destination

pub fn list_dir(
    &mut self,
    path: &Path
) -> Result<Vec<FsEntry>, FileTransferError>
[src]

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]

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]

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]

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]

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]

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

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

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]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,