mirror of
https://github.com/fluencelabs/rust-libp2p
synced 2025-06-12 01:21:21 +00:00
feat(swarm): remove deprecated IntoConnectionHandler
This removes the deprecated `IntoConnectionHandler` trait and all its implementations. Consequently, `NetworkBehaviour::new_handler` and `NetworkBehaviour::addresses_of_peer` are now gone and the two `handle_` functions are now required to implement. Related: #3647. Pull-Request: #3884.
This commit is contained in:
@ -121,12 +121,9 @@ pub use behaviour::{
|
||||
pub use connection::pool::{ConnectionCounters, ConnectionLimits};
|
||||
pub use connection::{ConnectionError, ConnectionId};
|
||||
pub use executor::Executor;
|
||||
#[allow(deprecated)]
|
||||
pub use handler::IntoConnectionHandler;
|
||||
pub use handler::{
|
||||
ConnectionHandler, ConnectionHandlerEvent, ConnectionHandlerSelect, ConnectionHandlerUpgrErr,
|
||||
IntoConnectionHandlerSelect, KeepAlive, OneShotHandler, OneShotHandlerConfig,
|
||||
SubstreamProtocol,
|
||||
KeepAlive, OneShotHandler, OneShotHandlerConfig, SubstreamProtocol,
|
||||
};
|
||||
#[cfg(feature = "macros")]
|
||||
pub use libp2p_swarm_derive::NetworkBehaviour;
|
||||
@ -174,8 +171,7 @@ type TBehaviourOutEvent<TBehaviour> = <TBehaviour as NetworkBehaviour>::OutEvent
|
||||
/// [`ConnectionHandler`] of the [`NetworkBehaviour`] for all the protocols the [`NetworkBehaviour`]
|
||||
/// supports.
|
||||
#[allow(deprecated)]
|
||||
pub type THandler<TBehaviour> =
|
||||
<<TBehaviour as NetworkBehaviour>::ConnectionHandler as IntoConnectionHandler>::Handler;
|
||||
pub type THandler<TBehaviour> = <TBehaviour as NetworkBehaviour>::ConnectionHandler;
|
||||
|
||||
/// Custom event that can be received by the [`ConnectionHandler`] of the
|
||||
/// [`NetworkBehaviour`].
|
||||
@ -1681,8 +1677,7 @@ pub enum DialError {
|
||||
LocalPeerId {
|
||||
endpoint: ConnectedPoint,
|
||||
},
|
||||
/// [`NetworkBehaviour::addresses_of_peer`] returned no addresses
|
||||
/// for the peer to dial.
|
||||
/// No addresses have been provided by [`NetworkBehaviour::handle_pending_outbound_connection`] and [`DialOpts`].
|
||||
NoAddresses,
|
||||
/// The provided [`dial_opts::PeerCondition`] evaluated to false and thus
|
||||
/// the dial was aborted.
|
||||
|
Reference in New Issue
Block a user