xrpl-rust icon indicating copy to clipboard operation
xrpl-rust copied to clipboard

Add clients

Open LimpidCrypto opened this issue 3 years ago • 1 comments

Clients:

WebsocketClient

std

Crates

DNS

The tokio crate provides dns lookup functionalities.

TLS

The crate tokio-rustls can be used to establish secure connections.

Networking

The crate embedded-websocket provides all functionalities for opening a websocket connection and sending/receiving messages through that connection. It takes a TcpStream to establish a connection.

no_std

Crates

DNS

TLS

The crate embedded-tls to establish secure connections.

Networking

JsonRpcClient

std

Crates

DNS

The tokio crate provides dns lookup functionalities we're using when the std feature is enabled.

TLS

The crate tokio-rustls can be used to establish secure connections.

Networking

The crate reqwless is used for HttpClient to send JsonRpc requests. It takes a TcpStream to establish a connection.

no_std

Crates

DNS

TLS

Networking

The crate reqwless is used for HttpClient to send JsonRpc requests. It takes a TcpStream to establish a connection.

Features

  • dns
  • tls

Traits

Client

_request_impl

An asynchronous driver for a given request.

AsyncClient

request

An asynchronous method which by default simply awaits the Client._request_impl method.

WebsocketBase

is_open

Checks if the websocket client is open.

_set_up_future

This method is to ensure that a request with an ID is backed by an open future.

_handler

An asynchronous method to resolve any outstanding futures for all messages we are receiving and push it to the message queue.

_do_open

An asynchronous method to connect to the host. It also sets the message queue and polls the _handler task.

_do_close

An asynchronous method to close the connection between the client and the host. It cancels the _handler task and any open request futures. We also clear the message queue here and finally close the connection.

_do_send

An asynchronous method which creates a future for the given request and then sends the request.

_do_request_impl

An asynchronous method that injects an ID into a request if the user haven't provided one. It then sends the request and waits for the future to be resolved to return the response.

LimpidCrypto avatar Jul 30 '22 18:07 LimpidCrypto

Discussion: https://github.com/sephynox/xrpl-rust/discussions/14#discussioncomment-3264839

LimpidCrypto avatar Aug 09 '22 22:08 LimpidCrypto