pub async fn retrieve_file(&mut self, path: &str) -> Result<Vec<u8>, crate::error::Error> {
        let mut conn = self.get_data_connection().await?;
        self.write_unary_command_expecting(
            "RETR",
            path,
            vec![
                StatusCodeKind::TransferAboutToStart,
                StatusCodeKind::TransferStarted,
            ],
        )
        .await?;

        let mut buffer = Vec::with_capacity(1024);
        conn.read_to_end(&mut buffer).await?;
        self.parse_reply_expecting(vec![StatusCodeKind::RequestActionCompleted])
            .await?;
        Ok(buffer)
    }
/// Download a file at a path into a byte buffer.
Download a file at a path into a byte buffer.
Download a file at a path into a byte buffer .
pub async fn retrieve_file(&mut self, path: &str) -> Result<Vec<u8>, crate::error::Error> {
        let mut conn = self.get_data_connection().await?;
        self.write_unary_command_expecting(
            "RETR",
            path,
            vec![
                StatusCodeKind::TransferAboutToStart,
                StatusCodeKind::TransferStarted,
            ],
        )
        .await?;
        let mut buffer = Vec::with_capacity(1024);
        conn.read_to_end(&mut buffer).await?;
        self.parse_reply_expecting(vec![StatusCodeKind::RequestActionCompleted])
            .await?;
        Ok(buffer)
    }
pub async fn retrieve_file ( & mut self , path : & str ) -> Result < Vec < u8 > , crate :: error :: Error > { let mut conn = self . get_data_connection ( ) . await ? ; self . write_unary_command_expecting ( " " , path , vec ! [ StatusCodeKind TransferAboutToStart StatusCodeKind TransferStarted ] , ) . await ? ; let mut buffer = Vec :: with_capacity ( 1024 ) ; conn . read_to_end ( & mut buffer ) . await ? ; self . parse_reply_expecting ( vec ! [ StatusCodeKind RequestActionCompleted ] ) . await ? ; Ok ( buffer ) }
Download a file at a path into a byte buffer.
Download a file at a path into a byte buffer .
&mut self
path
&str
&mut self
path
&str