Expand description
This crate contains a general request-response protocol. It is used to send requests to a set of recipients and wait for responses.
Modulesยง
- data_
source - The data source trait. Is what we use to derive the response data for a request
This file contains the
DataSource
trait. This trait allows the [RequestResponseProtocol
] to calculate/derive a response for a specific request. In the confirmation layer the implementer would be something like a [FeeMerkleTree
] for fee catchup - message
- The message type. Is the base type for all messages in the request-response protocol
- network
- The network traits. Is what we use to send and receive messages over the network as
the protocol
This file contains the
Sender
andReceiver
traits. These traits are used by the [RequestResponseProtocol
] to send and receive messages from a network or other source. - recipient_
source - The recipient source trait. Is what we use to get the recipients that a specific message should expect responses from
- request
- The request trait. Is what we use to define a request and a corresponding response type
This file contains the
Request
and [Response
] traits. Any upstream that wants to use the [RequestResponseProtocol
] needs to implement these traits for their specific types. - util ๐
- Utility types and functions
Structsยง
- Outgoing
Request - An outgoing request. This is what we use to track a request and its corresponding response in the protocol
- Outgoing
Request Inner - The inner implementation of an outgoing request
- Request
Response - A protocol that allows for request-response communication. Is cheaply cloneable, so there is no
need to wrap it in an
Arc
- Request
Response Config - The underlying configuration for the request-response protocol
- Request
Response Inner - The inner implementation for the request-response protocol
Enumsยง
- Request
Error - The errors that can occur when making a request for data
- Request
Type - The type of request to make
Traitsยง
- Serializable
- A trait for serializing and deserializing a type to and from a byte array.
Request
types and [Response
] types will need to implement this trait
Type Aliasesยง
- Incoming
Requests - A type alias for the list of tasks that are responding to requests
- Incoming
Responses - A type alias for the list of tasks that are validating incoming responses
- Outgoing
Requests Map - A type alias for the outgoing requests map
- Request
Hash - A type alias for the hash of a request
- Response
Validation ๐Fn - A type alias for the function that returns the above future
- Response
Validation ๐Future - A type alias for the future that validates a response
- Thread
Safe ๐Any - A type alias for an
Arc<dyn Any + Send + Sync + 'static>