Skip to content

Commit 694a09c

Browse files
committed
Add example for Command from NetworkBehaviour to Swarm
Note that this is only really valid once we have libp2p#3327 and the corresponding patch in `libp2p-swarm` `DialOpts`.
1 parent a951fbd commit 694a09c

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

docs/coding-guidelines.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -324,10 +324,9 @@ fn my_method() -> impl Future<Output = Response> {
324324
}
325325
```
326326

327-
When accepting a **command** that eventually results in a response through an event, either require
328-
that command to contain a unique ID, which is later on contained in the asynchronous response event,
329-
or allow the user to provide an instance of a custom type which again is later on returned in the
330-
response event.
327+
When accepting a **command** () that eventually results in a response through an event require that
328+
command to contain a unique ID, which is later on contained in the asynchronous response event. One
329+
such example is the `Swarm` accepting a `NetworkBehaviourAction::Dial` from the `NetworkBehaviour`.
331330

332331
``` rust
333332
struct Command {

0 commit comments

Comments
 (0)