mirror of
https://github.com/fluencelabs/rust-libp2p
synced 2025-06-24 15:21:33 +00:00
feat: introduce libp2p-connection-limits
connection management module
This patch deprecates the existing connection limits within `Swarm` and uses the new `NetworkBehaviour` APIs to implement it as a plugin instead. Related #2824. Pull-Request: #3386.
This commit is contained in:
@ -377,6 +377,7 @@ 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.
|
||||
@ -385,6 +386,7 @@ pub struct ConnectionLimit {
|
||||
pub current: u32,
|
||||
}
|
||||
|
||||
#[allow(deprecated)]
|
||||
impl fmt::Display for ConnectionLimit {
|
||||
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||
write!(
|
||||
@ -396,6 +398,7 @@ impl fmt::Display for ConnectionLimit {
|
||||
}
|
||||
|
||||
/// A `ConnectionLimit` can represent an error if it has been exceeded.
|
||||
#[allow(deprecated)]
|
||||
impl std::error::Error for ConnectionLimit {}
|
||||
|
||||
struct SubstreamUpgrade<UserData, Upgrade> {
|
||||
|
Reference in New Issue
Block a user