mirror of
https://github.com/fluencelabs/rust-libp2p
synced 2025-06-15 11:01:21 +00:00
swarm/src/behaviour: Deprecate NetworkBehaviourEventProcess (#2784)
In preparation for https://github.com/libp2p/rust-libp2p/pull/2751.
This commit is contained in:
@ -85,9 +85,9 @@ pub(crate) type THandlerOutEvent<THandler> =
|
||||
/// "MyCustomOutEvent")]`. If the user does not specify an `out_event`, the derive macro generates
|
||||
/// the event definition itself, naming it `<STRUCT_NAME>Event`.
|
||||
///
|
||||
/// When setting a custom `out_event`, the aforementioned conversion of each of the event types
|
||||
/// generated by the struct members to the custom `out_event` is handled by [`From`]
|
||||
/// implementations the user needs to provide.
|
||||
/// The aforementioned conversion of each of the event types generated by the struct members to the
|
||||
/// custom `out_event` is handled by [`From`] implementations which the user needs to define in
|
||||
/// addition to the event `enum` itself.
|
||||
///
|
||||
/// ``` rust
|
||||
/// # use libp2p::identify::{Identify, IdentifyEvent};
|
||||
@ -326,6 +326,13 @@ pub trait PollParameters {
|
||||
///
|
||||
/// You can opt out of this behaviour through `#[behaviour(event_process = false)]`. See the
|
||||
/// documentation of [`NetworkBehaviour`] for details.
|
||||
#[deprecated(
|
||||
since = "0.38.0",
|
||||
note = "Use `#[behaviour(out_event = \"MyBehaviourEvent\")]` instead. See \
|
||||
https://github.com/libp2p/rust-libp2p/blob/master/swarm/CHANGELOG.md#0380 \
|
||||
for instructions on how to migrate. Will be removed with \
|
||||
https://github.com/libp2p/rust-libp2p/pull/2751."
|
||||
)]
|
||||
pub trait NetworkBehaviourEventProcess<TEvent> {
|
||||
/// Called when one of the fields of the type you're deriving `NetworkBehaviour` on generates
|
||||
/// an event.
|
||||
|
Reference in New Issue
Block a user