pub struct HttpTransport { /* private fields */ }Expand description
An HTTP Transport for JSON RPC
Implementations§
Source§impl HttpTransport
impl HttpTransport
Sourcepub fn with_credentials(username: SecretString, password: SecretString) -> Self
pub fn with_credentials(username: SecretString, password: SecretString) -> Self
Instantiate a transport with BasicAuth credentials
Sourcepub fn with_credentials_and_url(
username: SecretString,
password: SecretString,
url: &str,
) -> Self
pub fn with_credentials_and_url( username: SecretString, password: SecretString, url: &str, ) -> Self
Instantiate a transport with BasicAuth credentials and a url
Trait Implementations§
Source§impl Debug for HttpTransport
impl Debug for HttpTransport
Source§impl Default for HttpTransport
impl Default for HttpTransport
Source§impl JsonRpcTransport for HttpTransport
impl JsonRpcTransport for HttpTransport
Source§fn request<'life0, 'life1, 'async_trait, T, R>(
&'life0 self,
method: &'life1 str,
params: T,
) -> Pin<Box<dyn Future<Output = Result<R, ProviderError>> + Send + 'async_trait>>where
T: 'async_trait + Serialize + Send + Sync,
R: 'async_trait + for<'a> Deserialize<'a>,
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn request<'life0, 'life1, 'async_trait, T, R>(
&'life0 self,
method: &'life1 str,
params: T,
) -> Pin<Box<dyn Future<Output = Result<R, ProviderError>> + Send + 'async_trait>>where
T: 'async_trait + Serialize + Send + Sync,
R: 'async_trait + for<'a> Deserialize<'a>,
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Sends a POST request with the provided method and the params serialized as JSON over HTTP
Auto Trait Implementations§
impl !Freeze for HttpTransport
impl !RefUnwindSafe for HttpTransport
impl Send for HttpTransport
impl Sync for HttpTransport
impl Unpin for HttpTransport
impl !UnwindSafe for HttpTransport
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