feat(core): make the upgrade module an implementation detail

Resolves: #3748.

Pull-Request: #3915.
This commit is contained in:
Thomas Eizinger
2023-05-15 15:24:18 +02:00
committed by GitHub
parent 5c785b92e7
commit 08f0b5e9c9
3 changed files with 11 additions and 4 deletions

View File

@ -66,10 +66,12 @@ mod ready;
mod select;
mod transfer;
pub(crate) use apply::{
apply, apply_inbound, apply_outbound, InboundUpgradeApply, OutboundUpgradeApply,
};
use futures::future::Future;
pub use self::{
apply::{apply, apply_inbound, apply_outbound, InboundUpgradeApply, OutboundUpgradeApply},
denied::DeniedUpgrade,
error::UpgradeError,
pending::PendingUpgrade,

View File

@ -29,7 +29,7 @@ pub(crate) use multistream_select::Version;
// TODO: Still needed?
/// Applies an upgrade to the inbound and outbound direction of a connection or substream.
pub fn apply<C, U>(
pub(crate) fn apply<C, U>(
conn: C,
up: U,
cp: ConnectedPoint,
@ -48,7 +48,7 @@ where
}
/// Tries to perform an upgrade on an inbound connection or substream.
pub fn apply_inbound<C, U>(conn: C, up: U) -> InboundUpgradeApply<C, U>
pub(crate) fn apply_inbound<C, U>(conn: C, up: U) -> InboundUpgradeApply<C, U>
where
C: AsyncRead + AsyncWrite + Unpin,
U: InboundUpgrade<Negotiated<C>>,
@ -62,7 +62,7 @@ where
}
/// Tries to perform an upgrade on an outbound connection or substream.
pub fn apply_outbound<C, U>(conn: C, up: U, v: Version) -> OutboundUpgradeApply<C, U>
pub(crate) fn apply_outbound<C, U>(conn: C, up: U, v: Version) -> OutboundUpgradeApply<C, U>
where
C: AsyncRead + AsyncWrite + Unpin,
U: OutboundUpgrade<Negotiated<C>>,