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:
parent
ad6525574b
commit
f58aaac1ae
|
|
@ -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};
|
||||||
|
|
|
||||||
|
|
@ -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 {
|
||||||
|
|
|
||||||
|
|
@ -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.
|
||||||
|
|
|
||||||
|
|
@ -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.
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue