We have moved the network module around to contain the TCP and TLS code. They each impl BrokerConnection which is a trait that abstracts out the reading, writing, and connecting over the network for their respective protocols.
Connection Config
We have a BrokerAddress struct that we use to hold a host and port. This is used by both the TCP and the TLS connection. The TLS connection also has a set of cert file paths that it needs.
Logic Changes
Each higher level struct like Producer and Consumer has a generic parameter which allows it to accept a TLS or TCP. This makes it know what type of config it requires.
The low level methods accept an impl BrokerConnection which you will see all over.
Major Changes to notice
Network Code
We have moved the
network
module around to contain the TCP and TLS code. They eachimpl BrokerConnection
which is a trait that abstracts out the reading, writing, and connecting over the network for their respective protocols.Connection Config
We have a
BrokerAddress
struct that we use to hold ahost
andport
. This is used by both the TCP and the TLS connection. The TLS connection also has a set of cert file paths that it needs.Logic Changes
Each higher level struct like Producer and Consumer has a generic parameter which allows it to accept a TLS or TCP. This makes it know what type of config it requires.
The low level methods accept an
impl BrokerConnection
which you will see all over.