From 79567d03de897cd1189159bd5d48b0c7d91c0a09 Mon Sep 17 00:00:00 2001 From: trivernis Date: Sat, 9 Oct 2021 18:58:23 +0200 Subject: [PATCH] Expose namespace and builder type Signed-off-by: trivernis --- Cargo.lock | 2 +- Cargo.toml | 2 +- src/ipc/stream_emitter.rs | 2 +- src/lib.rs | 2 ++ src/namespaces/namespace.rs | 1 + 5 files changed, 6 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 6022a5c6..fad54f39 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -148,7 +148,7 @@ dependencies = [ [[package]] name = "rmp-ipc" -version = "0.4.0" +version = "0.4.1" dependencies = [ "lazy_static", "log", diff --git a/Cargo.toml b/Cargo.toml index 4907a95d..a7faacf3 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "rmp-ipc" -version = "0.4.0" +version = "0.4.1" authors = ["trivernis "] edition = "2018" readme = "README.md" diff --git a/src/ipc/stream_emitter.rs b/src/ipc/stream_emitter.rs index 500074ef..a680385a 100644 --- a/src/ipc/stream_emitter.rs +++ b/src/ipc/stream_emitter.rs @@ -75,7 +75,7 @@ impl StreamEmitter { self._emit(None, event.as_ref(), data, Some(event_id)).await } - /// Emits a response to an event + /// Emits a response to an event to a namespace pub async fn emit_response_to, S2: AsRef, T: Serialize>( &self, event_id: u64, diff --git a/src/lib.rs b/src/lib.rs index 277d68e6..06d29128 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -81,3 +81,5 @@ pub use events::error_event; pub use events::event::Event; pub use ipc::builder::IPCBuilder; pub use ipc::*; +pub use namespaces::builder::NamespaceBuilder; +pub use namespaces::namespace::Namespace; diff --git a/src/namespaces/namespace.rs b/src/namespaces/namespace.rs index 65cd9b1b..4659eeb8 100644 --- a/src/namespaces/namespace.rs +++ b/src/namespaces/namespace.rs @@ -8,6 +8,7 @@ pub struct Namespace { } impl Namespace { + /// Creates a new namespace with an event handler to register event callbacks on pub fn new(name: S, handler: EventHandler) -> Self { Self { name: name.to_string(),