diff --git a/Cargo.toml b/Cargo.toml index b8da4e6..9161993 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "tarpc" -version = "0.11.0" +version = "0.12.0" authors = ["Adam Wright ", "Tim Kuehn "] license = "MIT" documentation = "https://docs.rs/tarpc" @@ -26,15 +26,16 @@ net2 = "0.2" num_cpus = "1.0" serde = "1.0" serde_derive = "1.0" -tarpc-plugins = { path = "src/plugins", version = "0.3.0" } +tarpc-plugins = { path = "src/plugins", version = "0.4.0" } thread-pool = "0.1.1" +tokio-codec = "0.1" tokio-core = "0.1.6" tokio-io = "0.1" tokio-proto = "0.1.1" tokio-service = "0.1" # Optional dependencies -native-tls = { version = "0.1.1", optional = true } +native-tls = { version = "0.1", optional = true } tokio-tls = { version = "0.1", optional = true } [dev-dependencies] diff --git a/README.md b/README.md index bf0e0a2..bea13b3 100644 --- a/README.md +++ b/README.md @@ -37,8 +37,8 @@ arguments to tarpc fns. Add to your `Cargo.toml` dependencies: ```toml -tarpc = "0.11.0" -tarpc-plugins = "0.2.0" +tarpc = "0.12.0" +tarpc-plugins = "0.4.0" ``` ## Example: Sync @@ -47,7 +47,7 @@ tarpc has two APIs: `sync` for blocking code and `future` for asynchronous code. Here's how to use the sync api. ```rust -#![feature(plugin, use_extern_macros)] +#![feature(plugin, use_extern_macros, proc_macro_path_invoc)] #![plugin(tarpc_plugins)] #[macro_use] @@ -100,7 +100,7 @@ races! See the `tarpc_examples` package for more examples. Here's the same service, implemented using futures. ```rust -#![feature(plugin, use_extern_macros)] +#![feature(plugin, use_extern_macros, proc_macro_path_invoc)] #![plugin(tarpc_plugins)] extern crate futures; @@ -171,7 +171,7 @@ However, if you are working with both stream types, ensure that you use the TLS servers and TCP clients with TCP servers. ```rust,no_run -#![feature(plugin, use_extern_macros)] +#![feature(plugin, use_extern_macros, proc_macro_path_invoc)] #![plugin(tarpc_plugins)] extern crate futures; diff --git a/benches/latency.rs b/benches/latency.rs index 8883e99..b6de567 100644 --- a/benches/latency.rs +++ b/benches/latency.rs @@ -3,7 +3,7 @@ // Licensed under the MIT License, . // This file may not be copied, modified, or distributed except according to those terms. -#![feature(plugin, test, use_extern_macros)] +#![feature(plugin, test, use_extern_macros, proc_macro_path_invoc)] #![plugin(tarpc_plugins)] #[macro_use] diff --git a/examples/concurrency.rs b/examples/concurrency.rs index e3ff5ca..67b1c79 100644 --- a/examples/concurrency.rs +++ b/examples/concurrency.rs @@ -3,7 +3,7 @@ // Licensed under the MIT License, . // This file may not be copied, modified, or distributed except according to those terms. -#![feature(plugin, never_type, use_extern_macros)] +#![feature(plugin, never_type, use_extern_macros, proc_macro_path_invoc)] #![plugin(tarpc_plugins)] extern crate chrono; diff --git a/examples/pubsub.rs b/examples/pubsub.rs index 88be54b..c2d2dca 100644 --- a/examples/pubsub.rs +++ b/examples/pubsub.rs @@ -3,7 +3,7 @@ // Licensed under the MIT License, . // This file may not be copied, modified, or distributed except according to those terms. -#![feature(plugin, use_extern_macros)] +#![feature(plugin, use_extern_macros, proc_macro_path_invoc)] #![plugin(tarpc_plugins)] extern crate env_logger; diff --git a/examples/readme_errors.rs b/examples/readme_errors.rs index 591dcef..3565f52 100644 --- a/examples/readme_errors.rs +++ b/examples/readme_errors.rs @@ -3,7 +3,7 @@ // Licensed under the MIT License, . // This file may not be copied, modified, or distributed except according to those terms. -#![feature(plugin, use_extern_macros)] +#![feature(plugin, use_extern_macros, proc_macro_path_invoc)] #![plugin(tarpc_plugins)] #[macro_use] diff --git a/examples/readme_futures.rs b/examples/readme_futures.rs index fbc358e..925ddca 100644 --- a/examples/readme_futures.rs +++ b/examples/readme_futures.rs @@ -3,7 +3,7 @@ // Licensed under the MIT License, . // This file may not be copied, modified, or distributed except according to those terms. -#![feature(plugin, use_extern_macros)] +#![feature(plugin, use_extern_macros, proc_macro_path_invoc)] #![plugin(tarpc_plugins)] extern crate futures; diff --git a/examples/readme_sync.rs b/examples/readme_sync.rs index 4ebe941..646a009 100644 --- a/examples/readme_sync.rs +++ b/examples/readme_sync.rs @@ -4,7 +4,7 @@ // This file may not be copied, modified, or distributed except according to those terms. // required by `FutureClient` (not used directly in this example) -#![feature(plugin, use_extern_macros)] +#![feature(plugin, use_extern_macros, proc_macro_path_invoc)] #![plugin(tarpc_plugins)] #[macro_use] diff --git a/examples/server_calling_server.rs b/examples/server_calling_server.rs index a0fcba3..fb93c3a 100644 --- a/examples/server_calling_server.rs +++ b/examples/server_calling_server.rs @@ -3,7 +3,7 @@ // Licensed under the MIT License, . // This file may not be copied, modified, or distributed except according to those terms. -#![feature(plugin, use_extern_macros)] +#![feature(plugin, use_extern_macros, proc_macro_path_invoc)] #![plugin(tarpc_plugins)] extern crate env_logger; diff --git a/examples/sync_server_calling_server.rs b/examples/sync_server_calling_server.rs index d6d10b1..5c2c01d 100644 --- a/examples/sync_server_calling_server.rs +++ b/examples/sync_server_calling_server.rs @@ -3,7 +3,7 @@ // Licensed under the MIT License, . // This file may not be copied, modified, or distributed except according to those terms. -#![feature(plugin, use_extern_macros)] +#![feature(plugin, use_extern_macros, proc_macro_path_invoc)] #![plugin(tarpc_plugins)] extern crate env_logger; diff --git a/examples/throughput.rs b/examples/throughput.rs index f85d5fd..bc7baa8 100644 --- a/examples/throughput.rs +++ b/examples/throughput.rs @@ -3,7 +3,7 @@ // Licensed under the MIT License, . // This file may not be copied, modified, or distributed except according to those terms. -#![feature(plugin, use_extern_macros)] +#![feature(plugin, use_extern_macros, proc_macro_path_invoc)] #![plugin(tarpc_plugins)] #[macro_use] diff --git a/examples/two_clients.rs b/examples/two_clients.rs index f65e388..5597323 100644 --- a/examples/two_clients.rs +++ b/examples/two_clients.rs @@ -3,7 +3,7 @@ // Licensed under the MIT License, . // This file may not be copied, modified, or distributed except according to those terms. -#![feature(plugin, use_extern_macros)] +#![feature(plugin, use_extern_macros, proc_macro_path_invoc)] #![plugin(tarpc_plugins)] #[macro_use] diff --git a/src/lib.rs b/src/lib.rs index dfee996..869ec18 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -27,7 +27,7 @@ //! Example usage: //! //! ``` -//! #![feature(plugin, use_extern_macros)] +//! #![feature(plugin, use_extern_macros, proc_macro_path_invoc)] //! #![plugin(tarpc_plugins)] //! //! #[macro_use] @@ -71,7 +71,7 @@ //! Example usage with TLS: //! //! ```no-run -//! #![feature(plugin, use_extern_macros)] +//! #![feature(plugin, use_extern_macros, proc_macro_path_invoc)] //! #![plugin(tarpc_plugins)] //! //! #[macro_use] @@ -116,7 +116,7 @@ #![deny(missing_docs, missing_debug_implementations)] #![feature(never_type)] -#![cfg_attr(test, feature(plugin, use_extern_macros))] +#![cfg_attr(test, feature(plugin, use_extern_macros, proc_macro_path_invoc))] #![cfg_attr(test, plugin(tarpc_plugins))] extern crate byteorder; @@ -130,6 +130,7 @@ extern crate log; extern crate net2; extern crate num_cpus; extern crate thread_pool; +extern crate tokio_codec; extern crate tokio_io; #[doc(hidden)] diff --git a/src/macros.rs b/src/macros.rs index 3ba4e06..9826783 100644 --- a/src/macros.rs +++ b/src/macros.rs @@ -14,7 +14,7 @@ macro_rules! as_item { /// Rpc methods are specified, mirroring trait syntax: /// /// ``` -/// # #![feature(plugin, use_extern_macros)] +/// # #![feature(plugin, use_extern_macros, proc_macro_path_invoc)] /// # #![plugin(tarpc_plugins)] /// # #[macro_use] extern crate tarpc; /// # fn main() {} @@ -657,7 +657,6 @@ mod functional_test { fn get_tls_client_context() -> Context { let mut connector = unwrap!(TlsConnector::builder()); unwrap!(connector.builder_mut() - .builder_mut() .set_ca_file("test/root-ca.pem")); Context { domain: DOMAIN.into(), diff --git a/src/plugins/Cargo.toml b/src/plugins/Cargo.toml index e2f477d..e41de1b 100644 --- a/src/plugins/Cargo.toml +++ b/src/plugins/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "tarpc-plugins" -version = "0.3.0" +version = "0.4.0" authors = ["Adam Wright ", "Tim Kuehn "] license = "MIT" documentation = "https://docs.rs/tarpc" diff --git a/src/plugins/src/lib.rs b/src/plugins/src/lib.rs index d415b0b..64bd2e5 100644 --- a/src/plugins/src/lib.rs +++ b/src/plugins/src/lib.rs @@ -8,7 +8,7 @@ use itertools::Itertools; use rustc_plugin::Registry; use syntax::ast::{self, Ident, TraitRef, Ty, TyKind}; use syntax::ext::base::{ExtCtxt, MacResult, DummyResult, MacEager}; -use syntax::ext::quote::rt::Span; +use syntax::codemap::Span; use syntax::parse::{self, token, str_lit, PResult}; use syntax::parse::parser::{Parser, PathStyle}; use syntax::symbol::Symbol; diff --git a/src/protocol.rs b/src/protocol.rs index e7e3131..a80bee1 100644 --- a/src/protocol.rs +++ b/src/protocol.rs @@ -12,7 +12,7 @@ use std::io; use std::marker::PhantomData; use std::mem; use tokio_io::{AsyncRead, AsyncWrite}; -use tokio_io::codec::{Encoder, Decoder, Framed}; +use tokio_codec::{Encoder, Decoder, Framed}; use tokio_proto::multiplex::{ClientProto, ServerProto}; use tokio_proto::streaming::multiplex::RequestId; @@ -74,9 +74,9 @@ where } let message_size = 2 * mem::size_of::() + payload_size as usize; buf.reserve(message_size); - buf.put_u64::(id); + buf.put_u64_be(id); trace!("Encoded request id = {} as {:?}", id, buf); - buf.put_u64::(payload_size); + buf.put_u64_be(payload_size); bincode::serialize_into(&mut buf.writer(), &message) .map_err(|serialize_err| { io::Error::new(io::ErrorKind::Other, serialize_err) @@ -180,7 +180,7 @@ where type BindTransport = Result; fn bind_transport(&self, io: T) -> Self::BindTransport { - Ok(io.framed(Codec::new(self.max_payload_size))) + Ok(Framed::new(io, Codec::new(self.max_payload_size))) } } @@ -196,7 +196,7 @@ where type BindTransport = Result; fn bind_transport(&self, io: T) -> Self::BindTransport { - Ok(io.framed(Codec::new(self.max_payload_size))) + Ok(Framed::new(io, Codec::new(self.max_payload_size))) } }