///Run a series of commands on this connection, using `buffer` for serialization.
///This prevents allocations as long as `buffer` is large enough from before. The
///buffer will be empty when this function returns.
Run a series of commands on this connection, using `buffer` for serialization.
This prevents allocations as long as `buffer` is large enough from before. The
buffer will be empty when this function returns.
Run a series of commands on this connection using ` buffer ` for serialization . This prevents allocations as long as ` buffer ` is large enough from before . The buffer will be empty when this function returns .
pub async fn run_commands_with_buffer(
        &mut self,
        command: CommandList<'_>,
        buf: &mut Vec<u8>,
    ) -> Result<ResponseStream> {
        buf.clear();
        let mut lock = self.stream.lock().await;
        let command_count = command.command_count();
        command.serialize(buf);
        lock.write_all(&buf).await?;
        buf.clear();
        Ok(ResponseStream::new(command_count, self.stream.clone()))
    }
pub async fn run_commands_with_buffer ( & mut self , command : CommandList < ' _ > , buf : & mut Vec < u8 > , ) -> Result < ResponseStream > { buf . clear ( ) ; let mut lock = self . stream . lock ( ) . await ; let command_count = command . command_count ( ) ; command . serialize ( buf ) ; lock . write_all ( & buf ) . await ? ; buf . clear ( ) ; Ok ( ResponseStream :: new ( command_count , self . stream . clone ( ) ) ) }
Run a series of commands on this connection, using `buffer` for serialization.
Run a series of commands on this connection using ` buffer ` for serialization .
&mut self
command
CommandList<'_>
buf
&mut Vec<u8>