sephynox / xrpl-rust

A 100% Rust library to interact with the XRPL. XRPL Grant Winner
https://crates.io/crates/xrpl-rust
ISC License
16 stars 8 forks source link

Add clients #17

Open LimpidCrypto opened 1 year ago

LimpidCrypto commented 1 year ago

Clients:

WebsocketClient

std

Crates

JsonRpcClient

std

Crates

Features

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 commented 1 year ago

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