pub struct RequestPipeline { /* private fields */ }Expand description
Request pipeline for managing multiple concurrent requests
Implementations§
Source§impl RequestPipeline
impl RequestPipeline
Sourcepub fn new(
connection: Arc<MultiplexedConnection>,
max_in_flight: usize,
buffer_size: usize,
) -> Self
pub fn new( connection: Arc<MultiplexedConnection>, max_in_flight: usize, buffer_size: usize, ) -> Self
Create a new request pipeline
Sourcepub fn client(&self) -> &Arc<PipelinedClient>
pub fn client(&self) -> &Arc<PipelinedClient>
Get the pipelined client
Sourcepub async fn submit(
&self,
data: Bytes,
) -> Result<Receiver<Result<Bytes, MultiplexError>>, MultiplexError>
pub async fn submit( &self, data: Bytes, ) -> Result<Receiver<Result<Bytes, MultiplexError>>, MultiplexError>
Submit a request to the pipeline
Sourcepub async fn process_incoming(
&self,
stream_id: u16,
data: Bytes,
) -> Result<(), MultiplexError>
pub async fn process_incoming( &self, stream_id: u16, data: Bytes, ) -> Result<(), MultiplexError>
Process incoming responses This should be called in a loop to handle responses
Sourcepub fn in_flight_count(&self) -> usize
pub fn in_flight_count(&self) -> usize
Get current in-flight count
Sourcepub fn can_accept(&self) -> bool
pub fn can_accept(&self) -> bool
Check if pipeline can accept more requests
Auto Trait Implementations§
impl !Freeze for RequestPipeline
impl !RefUnwindSafe for RequestPipeline
impl !UnwindSafe for RequestPipeline
impl Send for RequestPipeline
impl Sync for RequestPipeline
impl Unpin for RequestPipeline
impl UnsafeUnpin for RequestPipeline
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