diff --git a/protocols/rendezvous/src/lib.rs b/protocols/rendezvous/src/lib.rs index 221178728af..a34a0cbe3eb 100644 --- a/protocols/rendezvous/src/lib.rs +++ b/protocols/rendezvous/src/lib.rs @@ -24,7 +24,7 @@ use libp2p_swarm::StreamProtocol; -pub use self::codec::{Cookie, ErrorCode, Namespace, NamespaceTooLong, Registration, Ttl}; +pub use self::codec::{Cookie, ErrorCode, Namespace, NamespaceTooLong, Registration, Ttl, NewRegistration}; mod codec; diff --git a/protocols/rendezvous/src/server.rs b/protocols/rendezvous/src/server.rs index 572f82b057f..2c22744e39b 100644 --- a/protocols/rendezvous/src/server.rs +++ b/protocols/rendezvous/src/server.rs @@ -85,6 +85,10 @@ impl Behaviour { registrations: Registrations::with_config(config), } } + + pub fn add_registration(&mut self, registration: NewRegistration) -> Result { + self.registrations.add(registration) + } } #[derive(Debug)]