mirror of
https://github.com/veeso/termscp.git
synced 2025-12-07 09:36:00 -08:00
FsFile as argument for both recv_file and send_file
This commit is contained in:
@@ -26,7 +26,7 @@
|
||||
use std::io::{Read, Write};
|
||||
use std::path::{Path, PathBuf};
|
||||
|
||||
use crate::fs::FsEntry;
|
||||
use crate::fs::{FsFile, FsEntry};
|
||||
|
||||
// Transfers
|
||||
pub mod ftp_transfer;
|
||||
@@ -167,6 +167,7 @@ pub trait FileTransfer {
|
||||
/// ### mkdir
|
||||
///
|
||||
/// Make directory
|
||||
/// You must return error in case the directory already exists
|
||||
fn mkdir(&mut self, dir: &Path) -> Result<(), FileTransferError>;
|
||||
|
||||
/// ### remove
|
||||
@@ -190,13 +191,13 @@ pub trait FileTransfer {
|
||||
/// 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
|
||||
fn send_file(&mut self, file_name: &Path) -> Result<Box<dyn Write>, FileTransferError>;
|
||||
fn send_file(&mut self, local: &FsFile, file_name: &Path) -> Result<Box<dyn Write>, FileTransferError>;
|
||||
|
||||
/// ### recv_file
|
||||
///
|
||||
/// Receive file from remote with provided name
|
||||
/// Returns file and its size
|
||||
fn recv_file(&mut self, file_name: &Path) -> Result<Box<dyn Read>, FileTransferError>;
|
||||
fn recv_file(&mut self, file: &FsFile) -> Result<Box<dyn Read>, FileTransferError>;
|
||||
|
||||
/// ### on_sent
|
||||
///
|
||||
|
||||
Reference in New Issue
Block a user