Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(swarm): remove deprecated with_bandwidth_logging #5766

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 0 additions & 22 deletions libp2p/src/builder/phase/bandwidth_logging.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,28 +13,6 @@ pub struct BandwidthLoggingPhase<T, R> {
impl<T: AuthenticatedMultiplexedTransport, Provider, R>
SwarmBuilder<Provider, BandwidthLoggingPhase<T, R>>
{
#[allow(deprecated)]
#[deprecated(note = "Use `with_bandwidth_metrics` instead.")]
pub fn with_bandwidth_logging(
self,
) -> (
SwarmBuilder<Provider, BandwidthMetricsPhase<impl AuthenticatedMultiplexedTransport, R>>,
Arc<BandwidthSinks>,
) {
let (transport, sinks) = self.phase.transport.with_bandwidth_logging();
(
SwarmBuilder {
phase: BandwidthMetricsPhase {
relay_behaviour: self.phase.relay_behaviour,
transport,
},
keypair: self.keypair,
phantom: PhantomData,
},
sinks,
)
}

pub fn without_bandwidth_logging(self) -> SwarmBuilder<Provider, BandwidthMetricsPhase<T, R>> {
SwarmBuilder {
phase: BandwidthMetricsPhase {
Expand Down
22 changes: 0 additions & 22 deletions libp2p/src/builder/phase/other_transport.rs
Original file line number Diff line number Diff line change
Expand Up @@ -173,28 +173,6 @@ impl<T: AuthenticatedMultiplexedTransport, Provider>
.with_relay_client(security_upgrade, multiplexer_upgrade)
}
}
impl<Provider, T: AuthenticatedMultiplexedTransport>
SwarmBuilder<Provider, OtherTransportPhase<T>>
{
#[allow(deprecated)]
#[deprecated(note = "Use `with_bandwidth_metrics` instead.")]
pub fn with_bandwidth_logging(
self,
) -> (
SwarmBuilder<
Provider,
BandwidthMetricsPhase<impl AuthenticatedMultiplexedTransport, NoRelayBehaviour>,
>,
Arc<BandwidthSinks>,
) {
#[allow(deprecated)]
self.without_any_other_transports()
.without_dns()
.without_websocket()
.without_relay()
.with_bandwidth_logging()
}
}
#[cfg(feature = "metrics")]
impl<Provider, T: AuthenticatedMultiplexedTransport>
SwarmBuilder<Provider, OtherTransportPhase<T>>
Expand Down
21 changes: 0 additions & 21 deletions libp2p/src/builder/phase/quic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -276,27 +276,6 @@ impl_quic_phase_with_websocket!(
super::provider::Tokio,
rw_stream_sink::RwStreamSink<libp2p_websocket::BytesConnection<libp2p_tcp::tokio::TcpStream>>
);
impl<Provider, T: AuthenticatedMultiplexedTransport> SwarmBuilder<Provider, QuicPhase<T>> {
#[allow(deprecated)]
#[deprecated(note = "Use `with_bandwidth_metrics` instead.")]
pub fn with_bandwidth_logging(
self,
) -> (
SwarmBuilder<
Provider,
BandwidthMetricsPhase<impl AuthenticatedMultiplexedTransport, NoRelayBehaviour>,
>,
Arc<crate::bandwidth::BandwidthSinks>,
) {
#[allow(deprecated)]
self.without_quic()
.without_any_other_transports()
.without_dns()
.without_websocket()
.without_relay()
.with_bandwidth_logging()
}
}
#[cfg(feature = "metrics")]
impl<Provider, T: AuthenticatedMultiplexedTransport> SwarmBuilder<Provider, QuicPhase<T>> {
pub fn with_bandwidth_metrics(
Expand Down
Loading