pub struct BackpressureTransport { /* private fields */ }Expand description
A transport wrapper that limits concurrent in-flight requests.
If max_in_flight requests are already pending, new requests
immediately fail with TransportError::Overloaded.
Implementations§
Trait Implementations§
Source§impl RpcTransport for BackpressureTransport
impl RpcTransport for BackpressureTransport
Source§fn send<'life0, 'async_trait>(
&'life0 self,
req: JsonRpcRequest,
) -> Pin<Box<dyn Future<Output = Result<JsonRpcResponse, TransportError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn send<'life0, 'async_trait>(
&'life0 self,
req: JsonRpcRequest,
) -> Pin<Box<dyn Future<Output = Result<JsonRpcResponse, TransportError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Send a single JSON-RPC request and return the response.
Source§fn health(&self) -> HealthStatus
fn health(&self) -> HealthStatus
Return the current health status of this transport.
Source§fn send_batch<'life0, 'async_trait>(
&'life0 self,
reqs: Vec<JsonRpcRequest>,
) -> Pin<Box<dyn Future<Output = Result<Vec<JsonRpcResponse>, TransportError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn send_batch<'life0, 'async_trait>(
&'life0 self,
reqs: Vec<JsonRpcRequest>,
) -> Pin<Box<dyn Future<Output = Result<Vec<JsonRpcResponse>, TransportError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Send a batch of JSON-RPC requests. Read more
Source§fn call<'life0, 'life1, 'async_trait, T>(
&'life0 self,
id: u64,
method: &'life1 str,
params: Vec<Value>,
) -> Pin<Box<dyn Future<Output = Result<T, TransportError>> + Send + 'async_trait>>where
Self: Sized + 'async_trait,
T: 'async_trait + DeserializeOwned,
'life0: 'async_trait,
'life1: 'async_trait,
fn call<'life0, 'life1, 'async_trait, T>(
&'life0 self,
id: u64,
method: &'life1 str,
params: Vec<Value>,
) -> Pin<Box<dyn Future<Output = Result<T, TransportError>> + Send + 'async_trait>>where
Self: Sized + 'async_trait,
T: 'async_trait + DeserializeOwned,
'life0: 'async_trait,
'life1: 'async_trait,
Convenience: call a method and deserialize the result.
Auto Trait Implementations§
impl !Freeze for BackpressureTransport
impl !RefUnwindSafe for BackpressureTransport
impl Send for BackpressureTransport
impl Sync for BackpressureTransport
impl Unpin for BackpressureTransport
impl UnsafeUnpin for BackpressureTransport
impl !UnwindSafe for BackpressureTransport
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