Privately re-export ErrorSlot, ClientRequest in peer.

This means that all sub-modules of `peer` can import everything they need from
the `peer` module itself, without having to be aware of the internal structure
of their sibling modules.
This commit is contained in:
Henry de Valence 2019-11-27 11:46:26 -08:00 committed by Deirdre Connolly
parent ad6525574b
commit f58aaac1ae
4 changed files with 6 additions and 3 deletions

View File

@ -11,6 +11,9 @@ mod handshake;
/// Handles inbound requests from the network to our node. /// Handles inbound requests from the network to our node.
mod server; mod server;
use error::ErrorSlot;
use client::ClientRequest;
pub use client::Client; pub use client::Client;
pub use connector::Connector; pub use connector::Connector;
pub use error::{HandshakeError, PeerError, SharedPeerError}; pub use error::{HandshakeError, PeerError, SharedPeerError};

View File

@ -12,7 +12,7 @@ use tower::Service;
use crate::protocol::internal::{Request, Response}; use crate::protocol::internal::{Request, Response};
use super::{error::ErrorSlot, SharedPeerError}; use super::{ErrorSlot, SharedPeerError};
/// The "client" duplex half of a peer connection. /// The "client" duplex half of a peer connection.
pub struct Client { pub struct Client {

View File

@ -25,7 +25,7 @@ use crate::{
BoxedStdError, Config, BoxedStdError, Config,
}; };
use super::{error::ErrorSlot, HandshakeError, Client, Server}; use super::{ErrorSlot, HandshakeError, Client, Server};
/// A [`Service`] that handshakes with a remote peer and constructs a /// A [`Service`] that handshakes with a remote peer and constructs a
/// client/server pair. /// client/server pair.

View File

@ -22,7 +22,7 @@ use crate::{
BoxedStdError, BoxedStdError,
}; };
use super::{client::ClientRequest, error::ErrorSlot, PeerError, SharedPeerError}; use super::{ClientRequest, ErrorSlot, PeerError, SharedPeerError};
pub(super) enum State { pub(super) enum State {
/// Awaiting a client request or a peer message. /// Awaiting a client request or a peer message.