Reexport/tokio serde (#332)

Re-export tokio_serde when the serde-transport feature is enabled.
This commit is contained in:
Frederik-Baetens
2020-11-09 21:56:46 +01:00
committed by GitHub
parent 0bb2e2bbbe
commit 25aa857edf
5 changed files with 6 additions and 6 deletions

View File

@@ -19,8 +19,6 @@ futures = "0.3"
serde = { version = "1.0" }
tarpc = { version = "0.23", path = "../tarpc", features = ["full"] }
tokio = { version = "0.3", features = ["full"] }
tokio-serde = { version = "0.7.1", features = ["json"] }
tokio-util = { version = "0.5", features = ["codec"] }
[lib]
name = "service"

View File

@@ -6,8 +6,7 @@
use clap::{App, Arg};
use std::{io, net::SocketAddr};
use tarpc::{client, context};
use tokio_serde::formats::Json;
use tarpc::{client, context, tokio_serde::formats::Json};
#[tokio::main]
async fn main() -> io::Result<()> {

View File

@@ -14,8 +14,8 @@ use std::{
use tarpc::{
context,
server::{self, Channel, Handler},
tokio_serde::formats::Json,
};
use tokio_serde::formats::Json;
// This is the type that implements the generated World trait. It is the business logic
// and is used to start the server.

View File

@@ -17,7 +17,7 @@ default = []
serde1 = ["tarpc-plugins/serde1", "serde", "serde/derive"]
tokio1 = ["tokio/rt-multi-thread"]
serde-transport = ["tokio-serde", "tokio-util/codec"]
serde-transport = ["tokio-serde/json", "tokio-util/codec"]
tcp = ["tokio/net", "tokio/stream"]
full = ["serde1", "tokio1", "serde-transport", "tcp"]

View File

@@ -206,6 +206,9 @@ pub use rpc::*;
#[cfg(feature = "serde1")]
pub use serde;
#[cfg(feature = "serde-transport")]
pub use tokio_serde;
#[cfg(feature = "serde-transport")]
#[cfg_attr(docsrs, doc(cfg(feature = "serde-transport")))]
pub mod serde_transport;