Expose namespace and builder type

Signed-off-by: trivernis <trivernis@protonmail.com>
pull/6/head
trivernis 3 years ago
parent 4e16c237db
commit 79567d03de
Signed by: Trivernis
GPG Key ID: DFFFCC2C7A02DB45

2
Cargo.lock generated

@ -148,7 +148,7 @@ dependencies = [
[[package]]
name = "rmp-ipc"
version = "0.4.0"
version = "0.4.1"
dependencies = [
"lazy_static",
"log",

@ -1,6 +1,6 @@
[package]
name = "rmp-ipc"
version = "0.4.0"
version = "0.4.1"
authors = ["trivernis <trivernis@protonmail.com>"]
edition = "2018"
readme = "README.md"

@ -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<S1: AsRef<str>, S2: AsRef<str>, T: Serialize>(
&self,
event_id: u64,

@ -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;

@ -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<S: ToString>(name: S, handler: EventHandler) -> Self {
Self {
name: name.to_string(),

Loading…
Cancel
Save