pub async fn append<B: AsRef<[u8]>>(
        &mut self,
        path: &str,
        data: B,
    ) -> Result<(), crate::error::Error> {
        // Scope connection so it drops before reading server reply.
        {
            let mut conn = self.get_data_connection().await?;
            self.write_unary_command_expecting(
                "APPE",
                path,
                vec![
                    StatusCodeKind::TransferStarted,
                    StatusCodeKind::TransferAboutToStart,
                ],
            )
            .await?;
            conn.write_all(data.as_ref()).await?;
        }

        self.parse_reply_expecting(vec![
            StatusCodeKind::RequestActionCompleted,
            StatusCodeKind::RequestFileActionCompleted,
        ])
        .await?;

        Ok(())
    }
/// Append to a existing file or a create a new one.
Append to a existing file or a create a new one.
Append to a existing file or a create a new one .
pub async fn append<B: AsRef<[u8]>>(
        &mut self,
        path: &str,
        data: B,
    ) -> Result<(), crate::error::Error> {
        // Scope connection so it drops before reading server reply.
        {
            let mut conn = self.get_data_connection().await?;
            self.write_unary_command_expecting(
                "APPE",
                path,
                vec![
                    StatusCodeKind::TransferStarted,
                    StatusCodeKind::TransferAboutToStart,
                ],
            )
            .await?;
            conn.write_all(data.as_ref()).await?;
        }
        self.parse_reply_expecting(vec![
            StatusCodeKind::RequestActionCompleted,
            StatusCodeKind::RequestFileActionCompleted,
        ])
        .await?;
        Ok(())
    }
pub async fn append < B : AsRef < [ u8 ] > > ( & mut self , path : & str , data : B , ) -> Result < ( ) , crate :: error :: Error > { // Scope connection so it drops before reading server reply. { let mut conn = self . get_data_connection ( ) . await ? ; self . write_unary_command_expecting ( " " , path , vec ! [ StatusCodeKind TransferStarted StatusCodeKind TransferAboutToStart ] , ) . await ? ; conn . write_all ( data . as_ref ( ) ) . await ? ; } self . parse_reply_expecting ( vec ! [ StatusCodeKind RequestActionCompleted StatusCodeKind RequestFileActionCompleted ] ) . await ? ; Ok ( ( ) ) }
Append to a existing file or a create a new one.
Append to a existing file or a create a new one .
&mut self
path
&str
data
B
&mut self
path
&str
data
B