Skip to content

Commit a4110a2

Browse files
authored
*: Remove inject_connected / inject_disconnected from docs (#2805)
1 parent 1012579 commit a4110a2

File tree

3 files changed

+11
-16
lines changed

3 files changed

+11
-16
lines changed

protocols/gossipsub/src/behaviour.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3335,7 +3335,7 @@ where
33353335
));
33363336
} else if let Some(conn) = self.connected_peers.get_mut(&propagation_source) {
33373337
// Only change the value if the old value is Floodsub (the default set in
3338-
// inject_connected). All other PeerKind changes are ignored.
3338+
// inject_connection_established). All other PeerKind changes are ignored.
33393339
debug!(
33403340
"New peer type found: {} for peer: {}",
33413341
kind, propagation_source

swarm/src/behaviour.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -205,8 +205,7 @@ pub trait NetworkBehaviour: 'static {
205205
/// Informs the behaviour about a closed connection to a peer.
206206
///
207207
/// A call to this method is always paired with an earlier call to
208-
/// `inject_connection_established` with the same peer ID, connection ID and
209-
/// endpoint.
208+
/// [`NetworkBehaviour::inject_connection_established`] with the same peer ID, connection ID and endpoint.
210209
fn inject_connection_closed(
211210
&mut self,
212211
_: &PeerId,
@@ -230,8 +229,8 @@ pub trait NetworkBehaviour: 'static {
230229
/// Informs the behaviour about an event generated by the handler dedicated to the peer identified by `peer_id`.
231230
/// for the behaviour.
232231
///
233-
/// The `peer_id` is guaranteed to be in a connected state. In other words, `inject_connected`
234-
/// has previously been called with this `PeerId`.
232+
/// The `peer_id` is guaranteed to be in a connected state. In other words,
233+
/// [`NetworkBehaviour::inject_connection_established`] has previously been called with this `PeerId`.
235234
fn inject_event(
236235
&mut self,
237236
peer_id: PeerId,

swarm/src/lib.rs

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1701,13 +1701,12 @@ mod tests {
17011701
/// after which one peer bans the other.
17021702
///
17031703
/// The test expects both behaviours to be notified via pairs of
1704-
/// inject_connected / inject_disconnected as well as
1705-
/// inject_connection_established / inject_connection_closed calls
1706-
/// while unbanned.
1704+
/// [`NetworkBehaviour::inject_connection_established`] / [`NetworkBehaviour::inject_connection_closed`]
1705+
/// calls while unbanned.
17071706
///
17081707
/// While the ban is in effect, further dials occur. For these connections no
1709-
/// `inject_connected`, `inject_connection_established`, `inject_disconnected`,
1710-
/// `inject_connection_closed` calls should be registered.
1708+
/// [`NetworkBehaviour::inject_connection_established`], [`NetworkBehaviour::inject_connection_closed`]
1709+
/// calls should be registered.
17111710
#[test]
17121711
fn test_connect_disconnect_ban() {
17131712
// Since the test does not try to open any substreams, we can
@@ -1827,8 +1826,7 @@ mod tests {
18271826
/// after which one peer disconnects the other using [`Swarm::disconnect_peer_id`].
18281827
///
18291828
/// The test expects both behaviours to be notified via pairs of
1830-
/// inject_connected / inject_disconnected as well as
1831-
/// inject_connection_established / inject_connection_closed calls.
1829+
/// [`NetworkBehaviour::inject_connection_established`] / [`NetworkBehaviour::inject_connection_closed`] calls.
18321830
#[test]
18331831
fn test_swarm_disconnect() {
18341832
// Since the test does not try to open any substreams, we can
@@ -1896,8 +1894,7 @@ mod tests {
18961894
/// using [`NetworkBehaviourAction::CloseConnection`] returned by a [`NetworkBehaviour`].
18971895
///
18981896
/// The test expects both behaviours to be notified via pairs of
1899-
/// inject_connected / inject_disconnected as well as
1900-
/// inject_connection_established / inject_connection_closed calls.
1897+
/// [`NetworkBehaviour::inject_connection_established`] / [`NetworkBehaviour::inject_connection_closed`] calls.
19011898
#[test]
19021899
fn test_behaviour_disconnect_all() {
19031900
// Since the test does not try to open any substreams, we can
@@ -1967,8 +1964,7 @@ mod tests {
19671964
/// using [`NetworkBehaviourAction::CloseConnection`] returned by a [`NetworkBehaviour`].
19681965
///
19691966
/// The test expects both behaviours to be notified via pairs of
1970-
/// inject_connected / inject_disconnected as well as
1971-
/// inject_connection_established / inject_connection_closed calls.
1967+
/// [`NetworkBehaviour::inject_connection_established`] / [`NetworkBehaviour::inject_connection_closed`] calls.
19721968
#[test]
19731969
fn test_behaviour_disconnect_one() {
19741970
// Since the test does not try to open any substreams, we can

0 commit comments

Comments
 (0)