All crates should have a consistent API & naming
Discussed in https://github.com/libp2p/rust-libp2p/discussions/2174.
Summary:
Rename symbols within libp2p- sub crates such that they can best be references via the module that is re-exported from the libp2p meta-crate. For example:
use libp2p::ping;
let behaviour = ping::Behaviour::new(ping::Config::default());
Crates
- [x] https://github.com/libp2p/rust-libp2p/pull/2215
- [x] https://github.com/libp2p/rust-libp2p/pull/2937
- [x] https://github.com/libp2p/rust-libp2p/pull/2927
- [x] https://github.com/libp2p/rust-libp2p/pull/2961
- [x] https://github.com/libp2p/rust-libp2p/pull/3159
- [x] https://github.com/libp2p/rust-libp2p/pull/3238
- [x] https://github.com/libp2p/rust-libp2p/pull/3214
- [x] https://github.com/libp2p/rust-libp2p/pull/3096
- [x] https://github.com/libp2p/rust-libp2p/pull/3303
- [x] https://github.com/libp2p/rust-libp2p/pull/3852
- [x] https://github.com/libp2p/rust-libp2p/pull/3768
- [x] https://github.com/libp2p/rust-libp2p/pull/4535
- [x] https://github.com/libp2p/rust-libp2p/issues/4485
- [x] https://github.com/libp2p/rust-libp2p/issues/4486
- [x] https://github.com/libp2p/rust-libp2p/pull/5855
- [x] https://github.com/libp2p/rust-libp2p/pull/5870
- [x] https://github.com/libp2p/rust-libp2p/pull/5873
- [ ]
libp2p-uds:
I followed the same approach outlined here in https://github.com/libp2p/rust-libp2p/pull/2859 and introduced top-level dummy and keep_alive modules in libp2p-swarm. I think eventually, it would be great if we can also introduce these top-level modules in libp2p and re-export these kind of modules there. That would allow us to group things like dummy::Behaviour and dummy::ConnectionHandler together under libp2p::dummy which would be consistent with the re-export of sub-crates like libp2p::ping or libp2p::kad.
@jxs @thomaseizinger Hey guys, can I help with the UDS, if that one is still needed?
hi @momoshell thanks for the interest, yeah, go for it, I think it's only the UdsConfig type
@jxs and done! ✅
hi @momoshell thanks for the interest...
My pleasure! Since I've been using this library in production for a few years now, it's only natural to give something back. Will be jumping on other issues, if you guys let me, that is 😊