Skip to content

Commit

Permalink
swarm/src/behaviour: Move Toggle into swarm::behaviour (#2375)
Browse files Browse the repository at this point in the history
Co-authored-by: Max Inden <mail@max-inden.de>
  • Loading branch information
mexskican and mxinden authored Dec 9, 2021
1 parent cf271bc commit dd9e0a1
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 5 deletions.
3 changes: 3 additions & 0 deletions swarm/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,12 @@

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

- Move `swarm::Toggle` to `swarm::behaviour::Toggle` (see [PR 2375]).

[PR 2339]: https://github.com/libp2p/rust-libp2p/pull/2339
[PR 2350]: https://github.com/libp2p/rust-libp2p/pull/2350
[PR 2362]: https://github.com/libp2p/rust-libp2p/pull/2362
[PR 2375]: https://github.com/libp2p/rust-libp2p/pull/2375

# 0.32.0 [2021-11-16]

Expand Down
8 changes: 5 additions & 3 deletions swarm/src/behaviour.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE.

pub mod toggle;

use crate::dial_opts::DialOpts;
use crate::protocols_handler::{IntoProtocolsHandler, ProtocolsHandler};
use crate::{AddressRecord, AddressScore, DialError};
Expand Down Expand Up @@ -53,12 +55,12 @@ type THandlerInEvent<THandler> =
/// ## Combinators
///
/// [`NetworkBehaviour`] combinators wrap one or more [`NetworkBehaviour`] implementations and
/// implement [`NetworkBehaviour`] themselves. Example is the [`Toggle`](crate::toggle::Toggle)
/// [`NetworkBehaviour`].
/// implement [`NetworkBehaviour`] themselves. Example is the
/// [`Toggle`](crate::behaviour::toggle::Toggle) [`NetworkBehaviour`].
///
/// ``` rust
/// # use libp2p_swarm::DummyBehaviour;
/// # use libp2p_swarm::toggle::Toggle;
/// # use libp2p_swarm::behaviour::toggle::Toggle;
/// let my_behaviour = DummyBehaviour::default();
/// let my_toggled_behaviour = Toggle::from(Some(my_behaviour));
/// ```
Expand Down
File renamed without changes.
3 changes: 1 addition & 2 deletions swarm/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,15 +53,14 @@
//! are supported, when to open a new outbound substream, etc.
//!

mod behaviour;
mod registry;
#[cfg(test)]
mod test;
mod upgrade;

pub mod behaviour;
pub mod dial_opts;
pub mod protocols_handler;
pub mod toggle;

pub use behaviour::{
CloseConnection, NetworkBehaviour, NetworkBehaviourAction, NetworkBehaviourEventProcess,
Expand Down

0 comments on commit dd9e0a1

Please sign in to comment.