Merge pull request #6 from Trivernis/develop

Expose namespace and builder type
pull/7/head
Julius Riegel 3 years ago committed by GitHub
commit 969172fa29
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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