Struct web3::transports::ws::WebSocket [−][src]
pub struct WebSocket { /* fields omitted */ }
WebSocket transport
Methods
impl WebSocket
[src]
impl WebSocket
pub fn new(url: &str) -> Result<(EventLoopHandle, Self)>
[src]
pub fn new(url: &str) -> Result<(EventLoopHandle, Self)>
Create new WebSocket transport with separate event loop. NOTE: Dropping event loop handle will stop the transport layer!
pub fn with_event_loop(url: &str, handle: &Handle) -> Result<Self>
[src]
pub fn with_event_loop(url: &str, handle: &Handle) -> Result<Self>
Create new WebSocket transport within existing Event Loop.
Trait Implementations
impl Debug for WebSocket
[src]
impl Debug for WebSocket
fn fmt(&self, f: &mut Formatter) -> Result
[src]
fn fmt(&self, f: &mut Formatter) -> Result
Formats the value using the given formatter. Read more
impl Clone for WebSocket
[src]
impl Clone for WebSocket
fn clone(&self) -> WebSocket
[src]
fn clone(&self) -> WebSocket
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
1.0.0
[src]Performs copy-assignment from source
. Read more
impl Transport for WebSocket
[src]
impl Transport for WebSocket
type Out = WsTask<fn(_: Vec<Result<Value>>) -> Result<Value>>
The type of future this transport returns when a call is made.
fn prepare(&self, method: &str, params: Vec<Value>) -> (RequestId, Call)
[src]
fn prepare(&self, method: &str, params: Vec<Value>) -> (RequestId, Call)
Prepare serializable RPC call for given method with parameters.
fn send(&self, id: RequestId, request: Call) -> Self::Out
[src]
fn send(&self, id: RequestId, request: Call) -> Self::Out
Execute prepared RPC call.
fn execute(&self, method: &str, params: Vec<Value>) -> Self::Out
[src]
fn execute(&self, method: &str, params: Vec<Value>) -> Self::Out
Execute remote method with given parameters.
impl BatchTransport for WebSocket
[src]
impl BatchTransport for WebSocket
type Batch = WsTask<fn(_: Vec<Result<Value>>) -> Result<Vec<Result<Value>>>>
The type of future this transport returns when a call is made.
fn send_batch<T>(&self, requests: T) -> Self::Batch where
T: IntoIterator<Item = (RequestId, Call)>,
[src]
fn send_batch<T>(&self, requests: T) -> Self::Batch where
T: IntoIterator<Item = (RequestId, Call)>,
Sends a batch of prepared RPC calls.
impl DuplexTransport for WebSocket
[src]
impl DuplexTransport for WebSocket
type NotificationStream = Box<Stream<Item = Value, Error = Error> + Send + 'static>
The type of stream this transport returns
fn subscribe(&self, id: &SubscriptionId) -> Self::NotificationStream
[src]
fn subscribe(&self, id: &SubscriptionId) -> Self::NotificationStream
Add a subscription to this transport
fn unsubscribe(&self, id: &SubscriptionId)
[src]
fn unsubscribe(&self, id: &SubscriptionId)
Remove a subscription from this transport