mirror of
https://github.com/fluencelabs/rust-libp2p
synced 2025-05-09 09:32:16 +00:00
This PR refactors the error reporting away from panicking to returning `syn::Result` and adds two unit tests for the parsing of attributes that users interact with. Pull-Request: #3922.
20 lines
331 B
Rust
20 lines
331 B
Rust
use libp2p_ping as ping;
|
|
|
|
#[derive(libp2p_swarm::NetworkBehaviour)]
|
|
#[behaviour(out_event = FooEvent, prelude = "libp2p_swarm::derive_prelude")]
|
|
struct Foo {
|
|
ping: ping::Behaviour,
|
|
}
|
|
|
|
struct FooEvent;
|
|
|
|
impl From<ping::Event> for FooEvent {
|
|
fn from(_: ping::Event) -> Self {
|
|
unimplemented!()
|
|
}
|
|
}
|
|
|
|
fn main() {
|
|
|
|
}
|