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

        let reply = self
            .parse_reply_expecting(vec![StatusCodeKind::RequestActionCompleted])
            .await?;

        Ok(reply.message)
    }
/// Store a new file on a provided path using a random unique name.
Store a new file on a provided path using a random unique name.
Store a new file on a provided path using a random unique name .
pub async fn store_unique<B: AsRef<[u8]>>(
        &mut self,
        data: B,
    ) -> Result<String, crate::error::Error> {
        // Scope connection so it drops before reading server reply.
        {
            let mut conn = self.get_data_connection().await?;
            self.write_command_expecting(
                "STOU",
                vec![
                    StatusCodeKind::TransferStarted,
                    StatusCodeKind::TransferAboutToStart,
                ],
            )
            .await?;
            conn.write_all(data.as_ref()).await?;
        }
        let reply = self
            .parse_reply_expecting(vec![StatusCodeKind::RequestActionCompleted])
            .await?;
        Ok(reply.message)
    }
pub async fn store_unique < B : AsRef < [ u8 ] > > ( & mut self , data : B , ) -> Result < String , crate :: error :: Error > { // Scope connection so it drops before reading server reply. { let mut conn = self . get_data_connection ( ) . await ? ; self . write_command_expecting ( " " , vec ! [ StatusCodeKind TransferStarted StatusCodeKind TransferAboutToStart ] , ) . await ? ; conn . write_all ( data . as_ref ( ) ) . await ? ; } let reply = self . parse_reply_expecting ( vec ! [ StatusCodeKind RequestActionCompleted ] ) . await ? ; Ok ( reply . message ) }
Store a new file on a provided path using a random unique name.
Store a new file on a provided path using a random unique name .
&mut self
data
B
&mut self
data
B