pub struct HttpSender { /* private fields */ }
Implementations§
Source§impl HttpSender
impl HttpSender
Nonblocking RpcSender
over HTTP.
Sourcepub fn new<U: ToString>(url: U) -> Self
pub fn new<U: ToString>(url: U) -> Self
Create an HTTP RPC sender.
The URL is an HTTP URL, usually for port 8899, as in “http://localhost:8899”. The sender has a default timeout of 30 seconds.
Sourcepub fn new_with_timeout<U: ToString>(url: U, timeout: Duration) -> Self
pub fn new_with_timeout<U: ToString>(url: U, timeout: Duration) -> Self
Create an HTTP RPC sender.
The URL is an HTTP URL, usually for port 8899.
Sourcepub fn new_with_client<U: ToString>(url: U, client: Client) -> Self
pub fn new_with_client<U: ToString>(url: U, client: Client) -> Self
Create an HTTP RPC sender.
Most flexible way to create a sender. Pass a created reqwest::Client
.
Sourcepub fn new_with_client_with_middleware<U: ToString>(
url: U,
client: ClientWithMiddleware,
) -> Self
pub fn new_with_client_with_middleware<U: ToString>( url: U, client: ClientWithMiddleware, ) -> Self
Create an HTTP RPC sender.
Most flexible way to create a sender with middleware. Pass a created reqwest_middleware::ClientWithMiddleware
.
Sourcepub fn default_headers() -> HeaderMap
pub fn default_headers() -> HeaderMap
Create default headers used by HTTP Sender.
Trait Implementations§
Source§impl RpcSender for HttpSender
impl RpcSender for HttpSender
Auto Trait Implementations§
impl !Freeze for HttpSender
impl !RefUnwindSafe for HttpSender
impl Send for HttpSender
impl Sync for HttpSender
impl Unpin for HttpSender
impl !UnwindSafe for HttpSender
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more