pub(crate) struct HttpClientBackend {
inner: HttpTransport,
task_group: Arc<TaskGroup>,
}Expand description
HTTP client backend for JSON-RPC.
Fields§
§inner: HttpTransport§task_group: Arc<TaskGroup>Shared with the Client so driver tasks (h1 per-request, h3 connection) get cancelled when the Client stops.
Implementations§
Source§impl HttpClientBackend
impl HttpClientBackend
Sourcepub(crate) fn new(
endpoint: &Endpoint,
task_group: Arc<TaskGroup>,
) -> Result<Self>
pub(crate) fn new( endpoint: &Endpoint, task_group: Arc<TaskGroup>, ) -> Result<Self>
Create an HTTP/1.1 + HTTP/2 client.
Sourcepub(crate) async fn new_h3(
endpoint: &Endpoint,
quic_config: &ClientQuicConfig,
task_group: Arc<TaskGroup>,
) -> Result<Self>
pub(crate) async fn new_h3( endpoint: &Endpoint, quic_config: &ClientQuicConfig, task_group: Arc<TaskGroup>, ) -> Result<Self>
Create an HTTP/3 client (QUIC). The driver task is spawned via
task_group so it gets cancelled when the Client stops.
Sourcepub(crate) async fn send_request(&self, msg: Value) -> Result<Response>
pub(crate) async fn send_request(&self, msg: Value) -> Result<Response>
Send a JSON-RPC request and return the response.
Sourcepub(crate) async fn subscribe_h3(
&self,
msg: Value,
) -> Result<(Response, RequestStream<RecvStream, Bytes>)>
pub(crate) async fn subscribe_h3( &self, msg: Value, ) -> Result<(Response, RequestStream<RecvStream, Bytes>)>
Subscribe over HTTP/3. Returns the initial response + recv stream.
Auto Trait Implementations§
impl Freeze for HttpClientBackend
impl !RefUnwindSafe for HttpClientBackend
impl Send for HttpClientBackend
impl Sync for HttpClientBackend
impl Unpin for HttpClientBackend
impl UnsafeUnpin for HttpClientBackend
impl !UnwindSafe for HttpClientBackend
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