Skip to content

Commit d18e536

Browse files
committed
resolving problems
1 parent 7dd7219 commit d18e536

File tree

7 files changed

+41
-116
lines changed

7 files changed

+41
-116
lines changed

hole-punching-tests/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ license = "MIT"
99
anyhow = "1"
1010
env_logger = "0.10.2"
1111
futures = { workspace = true }
12-
libp2p = { path = "../libp2p", features = ["tokio", "dcutr", "identify", "macros", "noise", "ping", "relay", "tcp", "yamux", "quic"] }
12+
libp2p = { path = "../libp2p", features = ["tokio", "dcutr", "identify", "experimental-macros", "noise", "ping", "relay", "tcp", "yamux", "quic"] }
1313
tracing = { workspace = true }
1414
redis = { version = "0.24.0", default-features = false, features = ["tokio-comp"] }
1515
tokio = { workspace = true, features = ["full"] }

interop-tests/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ tracing-subscriber = { workspace = true, features = ["env-filter"] }
2222

2323
[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
2424
axum = "0.7"
25-
libp2p = { path = "../libp2p", features = [ "ping", "noise", "tls", "rsa", "macros", "websocket", "tokio", "yamux", "tcp", "dns", "identify", "quic"] }
25+
libp2p = { path = "../libp2p", features = [ "ping", "noise", "tls", "rsa", "experimental-macros", "websocket", "tokio", "yamux", "tcp", "dns", "identify", "quic"] }
2626
libp2p-mplex = { path = "../muxers/mplex" }
2727
libp2p-noise = { workspace = true }
2828
libp2p-tls = { workspace = true }
@@ -40,7 +40,7 @@ tracing = { workspace = true }
4040
tracing-subscriber = { workspace = true, features = ["env-filter"] }
4141

4242
[target.'cfg(target_arch = "wasm32")'.dependencies]
43-
libp2p = { path = "../libp2p", features = [ "ping", "macros", "webtransport-websys", "wasm-bindgen", "identify", "websocket-websys", "yamux", "noise"] }
43+
libp2p = { path = "../libp2p", features = [ "ping", "experimental-macros", "webtransport-websys", "wasm-bindgen", "identify", "websocket-websys", "yamux", "noise"] }
4444
libp2p-mplex = { path = "../muxers/mplex" }
4545
libp2p-webrtc-websys = { workspace = true }
4646
wasm-bindgen = { version = "0.2" }

protocols/perf/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ libp2p-core = { workspace = true }
2222
libp2p-dns = { workspace = true, features = ["tokio"] }
2323
libp2p-identity = { workspace = true, features = ["rand"] }
2424
libp2p-quic = { workspace = true, features = ["tokio"] }
25-
libp2p-swarm = { workspace = true, features = ["experimental-macros", "macros", "tokio"] }
25+
libp2p-swarm = { workspace = true, features = ["macros", "tokio"] }
2626
libp2p-tcp = { workspace = true, features = ["tokio"] }
2727
libp2p-tls = { workspace = true }
2828
libp2p-yamux = { workspace = true }

swarm-derive/src/experimental.rs

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -360,15 +360,6 @@ pub(crate) fn build_struct(
360360
) -> std::task::Poll<
361361
#connection_handler_event<Self::OutboundProtocol, Self::OutboundOpenInfo, Self::ToBehaviour>,
362362
> {
363-
// #(
364-
// if let std::task::Poll::Ready(event) = self.#fields.poll(cx) {
365-
// return std::task::Poll::Ready(event
366-
// .map_custom(#to_beh::#var_names)
367-
// .map_outbound_open_info(#ooi::#var_names)
368-
// .map_protocol(#ou::#var_names));
369-
// }
370-
// )*
371-
372363
let mut fuel = #beh_count;
373364
while fuel > 0 {
374365
// save the poll position to avoid repolling exhaused handlers

swarm-test/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ async-trait = "0.1.80"
1616
libp2p-core = { workspace = true }
1717
libp2p-identity = { workspace = true, features = ["rand"] }
1818
libp2p-plaintext = { workspace = true }
19-
libp2p-swarm = { workspace = true, features = ["experimental-macros", "async-std"] }
19+
libp2p-swarm = { workspace = true, features = ["async-std"] }
2020
libp2p-tcp = { workspace = true, features = ["async-io"] }
2121
libp2p-yamux = { workspace = true }
2222
futures = { workspace = true }

swarm/bench.backup.txt

Lines changed: 0 additions & 73 deletions
This file was deleted.

swarm/src/lib.rs

Lines changed: 36 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -122,35 +122,42 @@ pub mod derive_prelude {
122122
pub use libp2p_core::Multiaddr;
123123
pub use libp2p_identity::PeerId;
124124

125-
pub type TBehaviourOutEvent<TBehaviour> = <TBehaviour as NetworkBehaviour>::ToSwarm;
126-
pub type THandlerInProtocol<TBehaviour> =
127-
<THandler<TBehaviour> as ConnectionHandler>::InboundProtocol;
128-
pub type THandlerInOpenInfo<TBehaviour> =
129-
<THandler<TBehaviour> as ConnectionHandler>::InboundOpenInfo;
130-
pub type THandlerOutProtocol<TBehaviour> =
131-
<THandler<TBehaviour> as ConnectionHandler>::OutboundProtocol;
132-
pub type THandlerOutOpenInfo<TBehaviour> =
133-
<THandler<TBehaviour> as ConnectionHandler>::OutboundOpenInfo;
134-
pub type THandlerInUpgradeInfo<TBehaviour> =
135-
<THandlerInProtocol<TBehaviour> as UpgradeInfoSend>::Info;
136-
pub type THandlerOutUpgradeInfo<TBehaviour> =
137-
<THandlerOutProtocol<TBehaviour> as UpgradeInfoSend>::Info;
138-
pub type THandlerInUpgradeInfoIter<TBehaviour> =
139-
<THandlerInProtocol<TBehaviour> as UpgradeInfoSend>::InfoIter;
140-
pub type THandlerOutUpgradeInfoIter<TBehaviour> =
141-
<THandlerOutProtocol<TBehaviour> as UpgradeInfoSend>::InfoIter;
142-
pub type THandlerInUpgradeOutput<TBehaviour> =
143-
<THandlerInProtocol<TBehaviour> as InboundUpgradeSend>::Output;
144-
pub type THandlerOutUpgradeOutput<TBehaviour> =
145-
<THandlerOutProtocol<TBehaviour> as OutboundUpgradeSend>::Output;
146-
pub type THandlerInUpgradeError<TBehaviour> =
147-
<THandlerInProtocol<TBehaviour> as InboundUpgradeSend>::Error;
148-
pub type THandlerOutUpgradeError<TBehaviour> =
149-
<THandlerOutProtocol<TBehaviour> as OutboundUpgradeSend>::Error;
150-
pub type THandlerInUpgradeFuture<TBehaviour> =
151-
<THandlerInProtocol<TBehaviour> as InboundUpgradeSend>::Future;
152-
pub type THandlerOutUpgradeFuture<TBehaviour> =
153-
<THandlerOutProtocol<TBehaviour> as OutboundUpgradeSend>::Future;
125+
#[cfg(feature = "experimental-macros")]
126+
#[doc(hidden)]
127+
pub mod experimental {
128+
use super::*;
129+
pub type TBehaviourOutEvent<TBehaviour> = <TBehaviour as NetworkBehaviour>::ToSwarm;
130+
pub type THandlerInProtocol<TBehaviour> =
131+
<THandler<TBehaviour> as ConnectionHandler>::InboundProtocol;
132+
pub type THandlerInOpenInfo<TBehaviour> =
133+
<THandler<TBehaviour> as ConnectionHandler>::InboundOpenInfo;
134+
pub type THandlerOutProtocol<TBehaviour> =
135+
<THandler<TBehaviour> as ConnectionHandler>::OutboundProtocol;
136+
pub type THandlerOutOpenInfo<TBehaviour> =
137+
<THandler<TBehaviour> as ConnectionHandler>::OutboundOpenInfo;
138+
pub type THandlerInUpgradeInfo<TBehaviour> =
139+
<THandlerInProtocol<TBehaviour> as UpgradeInfoSend>::Info;
140+
pub type THandlerOutUpgradeInfo<TBehaviour> =
141+
<THandlerOutProtocol<TBehaviour> as UpgradeInfoSend>::Info;
142+
pub type THandlerInUpgradeInfoIter<TBehaviour> =
143+
<THandlerInProtocol<TBehaviour> as UpgradeInfoSend>::InfoIter;
144+
pub type THandlerOutUpgradeInfoIter<TBehaviour> =
145+
<THandlerOutProtocol<TBehaviour> as UpgradeInfoSend>::InfoIter;
146+
pub type THandlerInUpgradeOutput<TBehaviour> =
147+
<THandlerInProtocol<TBehaviour> as InboundUpgradeSend>::Output;
148+
pub type THandlerOutUpgradeOutput<TBehaviour> =
149+
<THandlerOutProtocol<TBehaviour> as OutboundUpgradeSend>::Output;
150+
pub type THandlerInUpgradeError<TBehaviour> =
151+
<THandlerInProtocol<TBehaviour> as InboundUpgradeSend>::Error;
152+
pub type THandlerOutUpgradeError<TBehaviour> =
153+
<THandlerOutProtocol<TBehaviour> as OutboundUpgradeSend>::Error;
154+
pub type THandlerInUpgradeFuture<TBehaviour> =
155+
<THandlerInProtocol<TBehaviour> as InboundUpgradeSend>::Future;
156+
pub type THandlerOutUpgradeFuture<TBehaviour> =
157+
<THandlerOutProtocol<TBehaviour> as OutboundUpgradeSend>::Future;
158+
}
159+
#[cfg(feature = "experimental-macros")]
160+
pub use experimental::*;
154161
}
155162

156163
pub use behaviour::{

0 commit comments

Comments
 (0)