mirror of
https://github.com/fluencelabs/rust-libp2p
synced 2025-08-01 01:11:58 +00:00
feat(swarm): remove deprecated connection limits
Users are encouraged to use `libp2p::connection_limit::Behaviour` which is a one-to-one replacement for this functionality but built as a `NetworkBehaviour`. Related: #3647. Pull-Request: #3885.
This commit is contained in:
@@ -400,31 +400,6 @@ impl<'a> IncomingInfo<'a> {
|
||||
}
|
||||
}
|
||||
|
||||
/// Information about a connection limit.
|
||||
#[deprecated(note = "Use `libp2p::connection_limits` instead.", since = "0.42.1")]
|
||||
#[derive(Debug, Clone, Copy)]
|
||||
pub struct ConnectionLimit {
|
||||
/// The maximum number of connections.
|
||||
pub limit: u32,
|
||||
/// The current number of connections.
|
||||
pub current: u32,
|
||||
}
|
||||
|
||||
#[allow(deprecated)]
|
||||
impl fmt::Display for ConnectionLimit {
|
||||
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||
write!(
|
||||
f,
|
||||
"connection limit exceeded ({}/{})",
|
||||
self.current, self.limit
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
/// A `ConnectionLimit` can represent an error if it has been exceeded.
|
||||
#[allow(deprecated)]
|
||||
impl std::error::Error for ConnectionLimit {}
|
||||
|
||||
struct SubstreamUpgrade<UserData, Upgrade> {
|
||||
user_data: Option<UserData>,
|
||||
timeout: Delay,
|
||||
|
Reference in New Issue
Block a user