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 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