Fix compile errors

Signed-off-by: trivernis <trivernis@protonmail.com>
pull/32/head
trivernis 3 years ago
parent fbee60e64b
commit 2527763494
Signed by: Trivernis
GPG Key ID: DFFFCC2C7A02DB45

@ -6,19 +6,19 @@
//! use tokio::net::TcpListener;
//!
//! /// Callback ping function
//! async fn handle_ping(ctx: &Context, event: Event) -> IPCResult<()> {
//! async fn handle_ping(ctx: &Context, event: Event) -> IPCResult<Response> {
//! println!("Received ping event.");
//! ctx.emit("pong", ()).await?;
//!
//! Ok(())
//! Ok(Response::empty())
//! }
//!
//! pub struct MyNamespace;
//!
//! impl MyNamespace {
//! async fn ping(_ctx: &Context, _event: Event) -> IPCResult<()> {
//! async fn ping(_ctx: &Context, _event: Event) -> IPCResult<Response> {
//! println!("My namespace received a ping");
//! Ok(())
//! Ok(Response::empty())
//! }
//! }
//!
@ -46,7 +46,7 @@
//! .on("something", callback!(ctx, event, async move {
//! println!("I think the server did something");
//! ctx.emit_to("mainspace-server", "ok", ()).await?;
//! Ok(())
//! Ok(Response::empty())
//! }))
//! .build()
//! .add_namespace(namespace!(MyNamespace))
@ -63,7 +63,7 @@
//! use std::net::ToSocketAddrs;
//! use typemap_rev::TypeMapKey;
//! use bromine::IPCBuilder;
//! use bromine::callback;
//! use bromine::prelude::*;
//! use tokio::net::TcpListener;
//!
//! struct MyKey;
@ -80,7 +80,7 @@
//! .on("ping", callback!(ctx, event, async move {
//! println!("Received ping event.");
//! ctx.emit("pong", ()).await?;
//! Ok(())
//! Ok(Response::empty())
//! }))
//! .namespace("mainspace-server")
//! .on("do-something", callback!(ctx, event, async move {
@ -92,7 +92,7 @@
//! *my_key += 1;
//! }
//! ctx.emit_to("mainspace-client", "something", ()).await?;
//! Ok(())
//! Ok(Response::empty())
//! }))
//! .build()
//! // store additional data

@ -2,6 +2,7 @@
use bromine::prelude::*;
#[cfg(feature = "serialize")]
use serde::{de::DeserializeOwned, Serialize};
use std::fmt::Debug;
#[cfg(feature = "serialize_rmp")]
#[test]

Loading…
Cancel
Save