Skip to content

Commit dd9e0a1

Browse files
mexskicanmxinden
andauthored
swarm/src/behaviour: Move Toggle into swarm::behaviour (libp2p#2375)
Co-authored-by: Max Inden <[email protected]>
1 parent cf271bc commit dd9e0a1

File tree

4 files changed

+9
-5
lines changed

4 files changed

+9
-5
lines changed

swarm/CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,12 @@
88

99
- Update `Connection::address` on `inject_address_change` (see [PR 2362]).
1010

11+
- Move `swarm::Toggle` to `swarm::behaviour::Toggle` (see [PR 2375]).
12+
1113
[PR 2339]: https://github.com/libp2p/rust-libp2p/pull/2339
1214
[PR 2350]: https://github.com/libp2p/rust-libp2p/pull/2350
1315
[PR 2362]: https://github.com/libp2p/rust-libp2p/pull/2362
16+
[PR 2375]: https://github.com/libp2p/rust-libp2p/pull/2375
1417

1518
# 0.32.0 [2021-11-16]
1619

swarm/src/behaviour.rs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@
1818
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
1919
// DEALINGS IN THE SOFTWARE.
2020

21+
pub mod toggle;
22+
2123
use crate::dial_opts::DialOpts;
2224
use crate::protocols_handler::{IntoProtocolsHandler, ProtocolsHandler};
2325
use crate::{AddressRecord, AddressScore, DialError};
@@ -53,12 +55,12 @@ type THandlerInEvent<THandler> =
5355
/// ## Combinators
5456
///
5557
/// [`NetworkBehaviour`] combinators wrap one or more [`NetworkBehaviour`] implementations and
56-
/// implement [`NetworkBehaviour`] themselves. Example is the [`Toggle`](crate::toggle::Toggle)
57-
/// [`NetworkBehaviour`].
58+
/// implement [`NetworkBehaviour`] themselves. Example is the
59+
/// [`Toggle`](crate::behaviour::toggle::Toggle) [`NetworkBehaviour`].
5860
///
5961
/// ``` rust
6062
/// # use libp2p_swarm::DummyBehaviour;
61-
/// # use libp2p_swarm::toggle::Toggle;
63+
/// # use libp2p_swarm::behaviour::toggle::Toggle;
6264
/// let my_behaviour = DummyBehaviour::default();
6365
/// let my_toggled_behaviour = Toggle::from(Some(my_behaviour));
6466
/// ```
File renamed without changes.

swarm/src/lib.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,15 +53,14 @@
5353
//! are supported, when to open a new outbound substream, etc.
5454
//!
5555
56-
mod behaviour;
5756
mod registry;
5857
#[cfg(test)]
5958
mod test;
6059
mod upgrade;
6160

61+
pub mod behaviour;
6262
pub mod dial_opts;
6363
pub mod protocols_handler;
64-
pub mod toggle;
6564

6665
pub use behaviour::{
6766
CloseConnection, NetworkBehaviour, NetworkBehaviourAction, NetworkBehaviourEventProcess,

0 commit comments

Comments
 (0)