pub struct PipelinedClient { /* private fields */ }Expand description
Pipelined client for request pipelining
Implementations§
Source§impl PipelinedClient
impl PipelinedClient
Sourcepub fn new(connection: Arc<MultiplexedConnection>, max_in_flight: usize) -> Self
pub fn new(connection: Arc<MultiplexedConnection>, max_in_flight: usize) -> Self
Create a new pipelined client
Sourcepub fn connection(&self) -> &Arc<MultiplexedConnection>
pub fn connection(&self) -> &Arc<MultiplexedConnection>
Get the underlying connection
Sourcepub fn in_flight_count(&self) -> usize
pub fn in_flight_count(&self) -> usize
Get current in-flight request count
Sourcepub async fn send(
&self,
data: Bytes,
) -> Result<Receiver<Result<Bytes, MultiplexError>>, MultiplexError>
pub async fn send( &self, data: Bytes, ) -> Result<Receiver<Result<Bytes, MultiplexError>>, MultiplexError>
Send a pipelined request Returns a future that resolves when the response is received
Sourcepub async fn send_batch(
&self,
requests: Vec<Bytes>,
) -> Result<Vec<Receiver<Result<Bytes, MultiplexError>>>, MultiplexError>
pub async fn send_batch( &self, requests: Vec<Bytes>, ) -> Result<Vec<Receiver<Result<Bytes, MultiplexError>>>, MultiplexError>
Send multiple requests in a batch
Sourcepub async fn process_response(
&self,
stream_id: u16,
data: Bytes,
) -> Result<(), MultiplexError>
pub async fn process_response( &self, stream_id: u16, data: Bytes, ) -> Result<(), MultiplexError>
Process a response for a stream
Sourcepub async fn process_error(
&self,
stream_id: u16,
error: MultiplexError,
) -> Result<(), MultiplexError>
pub async fn process_error( &self, stream_id: u16, error: MultiplexError, ) -> Result<(), MultiplexError>
Process an error for a stream
Sourcepub async fn cancel_all(&self)
pub async fn cancel_all(&self)
Cancel all pending requests
Sourcepub async fn pending_count(&self) -> usize
pub async fn pending_count(&self) -> usize
Get pending request count
Auto Trait Implementations§
impl !Freeze for PipelinedClient
impl !RefUnwindSafe for PipelinedClient
impl !UnwindSafe for PipelinedClient
impl Send for PipelinedClient
impl Sync for PipelinedClient
impl Unpin for PipelinedClient
impl UnsafeUnpin for PipelinedClient
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more