pub struct SftpDownloadCommand { /* private fields */ }Expand description
Command that executes an SFTP file download from a remote server to local disk.
This is the primary integration point between the aria2 download engine and the SFTP protocol layer. It manages the full lifecycle of an SFTP download including connection management, authentication, data transfer, progress tracking, and cleanup.
Implementations§
Source§impl SftpDownloadCommand
impl SftpDownloadCommand
Sourcepub fn new(
gid: GroupId,
uri: &str,
options: &DownloadOptions,
output_dir: Option<&str>,
output_name: Option<&str>,
) -> Result<Self>
pub fn new( gid: GroupId, uri: &str, options: &DownloadOptions, output_dir: Option<&str>, output_name: Option<&str>, ) -> Result<Self>
Create a new SFTP download command.
§Arguments
gid- Unique group identifier for this downloaduri- The sftp:// URI to download fromoptions- Download configuration optionsoutput_dir- Optional override for output directoryoutput_name- Optional override for output filename
§URI Format
sftp://[user[:password]@]host[:port]/path/to/file
Examples:
sftp://user@example.com/path/to/file.txt
sftp://admin:secret@192.168.1.100:2222/data/archive.tar.gz
sftp://root@server.example.com:22/etc/config.confSourcepub async fn group(&self) -> RwLockReadGuard<'_, RequestGroup>
pub async fn group(&self) -> RwLockReadGuard<'_, RequestGroup>
Get a read-only reference to the request group.
Trait Implementations§
Source§impl Command for SftpDownloadCommand
impl Command for SftpDownloadCommand
Source§fn execute<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn execute<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Execute the SFTP download.
This is the main entry point called by the download engine. It orchestrates the entire download lifecycle from connection establishment through data transfer to cleanup.
Source§fn status(&self) -> CommandStatus
fn status(&self) -> CommandStatus
Return the current status of this command.
Source§fn started_at(&self) -> Option<Instant>
fn started_at(&self) -> Option<Instant>
Returns the instant at which this command started executing, if the
engine has informed the command via [
set_started_at]. Read moreSource§fn set_started_at(&mut self, _instant: Instant)
fn set_started_at(&mut self, _instant: Instant)
Called by the engine immediately before the command is spawned onto a
background task. The default implementation is a no-op; commands that
store the instant can expose it through [
started_at].Auto Trait Implementations§
impl !RefUnwindSafe for SftpDownloadCommand
impl !UnwindSafe for SftpDownloadCommand
impl Freeze for SftpDownloadCommand
impl Send for SftpDownloadCommand
impl Sync for SftpDownloadCommand
impl Unpin for SftpDownloadCommand
impl UnsafeUnpin for SftpDownloadCommand
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more