Struct web3::transports::http::Http
source · pub struct Http { /* private fields */ }
Expand description
HTTP Transport (synchronous)
Implementations§
source§impl Http
impl Http
sourcepub fn new(url: &str) -> Result<(EventLoopHandle, Self)>
pub fn new(url: &str) -> Result<(EventLoopHandle, Self)>
Create new HTTP transport with given URL and spawn an event loop in a separate thread. NOTE: Dropping event loop handle will stop the transport layer!
sourcepub fn with_max_parallel(
url: &str,
max_parallel: usize
) -> Result<(EventLoopHandle, Self)>
pub fn with_max_parallel(
url: &str,
max_parallel: usize
) -> Result<(EventLoopHandle, Self)>
Create new HTTP transport with given URL and spawn an event loop in a separate thread. You can set a maximal number of parallel requests using the second parameter. NOTE: Dropping event loop handle will stop the transport layer!