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

        let mut buffer = Vec::with_capacity(1024);
        conn.read_to_end(&mut buffer).await?;
        self.parse_reply_expecting(vec![StatusCodeKind::RequestActionCompleted])
            .await?;
        let text = String::from_utf8(buffer).map_err(|_| {
            crate::error::Error::SerializationFailed(
                "Invalid ASCII returned on server directory name listing.".to_string(),
            )
        })?;
        Ok(text.lines().map(|line| line.to_owned()).collect())
    }
/// List the provided path, providing only name information about files and directories.
List the provided path, providing only name information about files and directories.
List the provided path providing only name information about files and directories .
pub async fn list_names(&mut self, path: &str) -> Result<Vec<String>, crate::error::Error> {
        let mut conn = self.get_data_connection().await?;
        self.write_unary_command_expecting(
            "NLST",
            path,
            vec![
                StatusCodeKind::TransferStarted,
                StatusCodeKind::TransferAboutToStart,
            ],
        )
        .await?;
        let mut buffer = Vec::with_capacity(1024);
        conn.read_to_end(&mut buffer).await?;
        self.parse_reply_expecting(vec![StatusCodeKind::RequestActionCompleted])
            .await?;
        let text = String::from_utf8(buffer).map_err(|_| {
            crate::error::Error::SerializationFailed(
                "Invalid ASCII returned on server directory name listing.".to_string(),
            )
        })?;
        Ok(text.lines().map(|line| line.to_owned()).collect())
    }
pub async fn list_names ( & mut self , path : & str ) -> Result < Vec < String > , crate :: error :: Error > { let mut conn = self . get_data_connection ( ) . await ? ; self . write_unary_command_expecting ( " " , path , vec ! [ StatusCodeKind TransferStarted StatusCodeKind TransferAboutToStart ] , ) . await ? ; let mut buffer = Vec :: with_capacity ( 1024 ) ; conn . read_to_end ( & mut buffer ) . await ? ; self . parse_reply_expecting ( vec ! [ StatusCodeKind RequestActionCompleted ] ) . await ? ; let text = String :: from_utf8 ( buffer ) . map_err ( | _ | { crate :: error :: Error :: SerializationFailed ( " " . to_string ( ) , ) } ) ? ; Ok ( text . lines ( ) . map ( | line | line . to_owned ( ) ) . collect ( ) ) }
List the provided path, providing only name information about files and directories.
List the provided path providing only name information about files and directories .
&mut self
path
&str
&mut self
path
&str