mirror of
https://github.com/OMGeeky/tarpc.git
synced 2026-02-23 15:49:54 +01:00
Minor change rollup
* Head off imminent breakage due to https://github.com/rust-lang/rust/pull/51285. * Fix examples and documentation to use a recently-gated feature, `proc_macro_path_invoc`. * Update dependency versions.
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "tarpc"
|
name = "tarpc"
|
||||||
version = "0.11.0"
|
version = "0.12.0"
|
||||||
authors = ["Adam Wright <adam.austin.wright@gmail.com>", "Tim Kuehn <timothy.j.kuehn@gmail.com>"]
|
authors = ["Adam Wright <adam.austin.wright@gmail.com>", "Tim Kuehn <timothy.j.kuehn@gmail.com>"]
|
||||||
license = "MIT"
|
license = "MIT"
|
||||||
documentation = "https://docs.rs/tarpc"
|
documentation = "https://docs.rs/tarpc"
|
||||||
@@ -26,15 +26,16 @@ net2 = "0.2"
|
|||||||
num_cpus = "1.0"
|
num_cpus = "1.0"
|
||||||
serde = "1.0"
|
serde = "1.0"
|
||||||
serde_derive = "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"
|
thread-pool = "0.1.1"
|
||||||
|
tokio-codec = "0.1"
|
||||||
tokio-core = "0.1.6"
|
tokio-core = "0.1.6"
|
||||||
tokio-io = "0.1"
|
tokio-io = "0.1"
|
||||||
tokio-proto = "0.1.1"
|
tokio-proto = "0.1.1"
|
||||||
tokio-service = "0.1"
|
tokio-service = "0.1"
|
||||||
|
|
||||||
# Optional dependencies
|
# Optional dependencies
|
||||||
native-tls = { version = "0.1.1", optional = true }
|
native-tls = { version = "0.1", optional = true }
|
||||||
tokio-tls = { version = "0.1", optional = true }
|
tokio-tls = { version = "0.1", optional = true }
|
||||||
|
|
||||||
[dev-dependencies]
|
[dev-dependencies]
|
||||||
|
|||||||
10
README.md
10
README.md
@@ -37,8 +37,8 @@ arguments to tarpc fns.
|
|||||||
Add to your `Cargo.toml` dependencies:
|
Add to your `Cargo.toml` dependencies:
|
||||||
|
|
||||||
```toml
|
```toml
|
||||||
tarpc = "0.11.0"
|
tarpc = "0.12.0"
|
||||||
tarpc-plugins = "0.2.0"
|
tarpc-plugins = "0.4.0"
|
||||||
```
|
```
|
||||||
|
|
||||||
## Example: Sync
|
## 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.
|
code. Here's how to use the sync api.
|
||||||
|
|
||||||
```rust
|
```rust
|
||||||
#![feature(plugin, use_extern_macros)]
|
#![feature(plugin, use_extern_macros, proc_macro_path_invoc)]
|
||||||
#![plugin(tarpc_plugins)]
|
#![plugin(tarpc_plugins)]
|
||||||
|
|
||||||
#[macro_use]
|
#[macro_use]
|
||||||
@@ -100,7 +100,7 @@ races! See the `tarpc_examples` package for more examples.
|
|||||||
Here's the same service, implemented using futures.
|
Here's the same service, implemented using futures.
|
||||||
|
|
||||||
```rust
|
```rust
|
||||||
#![feature(plugin, use_extern_macros)]
|
#![feature(plugin, use_extern_macros, proc_macro_path_invoc)]
|
||||||
#![plugin(tarpc_plugins)]
|
#![plugin(tarpc_plugins)]
|
||||||
|
|
||||||
extern crate futures;
|
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.
|
servers and TCP clients with TCP servers.
|
||||||
|
|
||||||
```rust,no_run
|
```rust,no_run
|
||||||
#![feature(plugin, use_extern_macros)]
|
#![feature(plugin, use_extern_macros, proc_macro_path_invoc)]
|
||||||
#![plugin(tarpc_plugins)]
|
#![plugin(tarpc_plugins)]
|
||||||
|
|
||||||
extern crate futures;
|
extern crate futures;
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
// Licensed under the MIT License, <LICENSE or http://opensource.org/licenses/MIT>.
|
// Licensed under the MIT License, <LICENSE or http://opensource.org/licenses/MIT>.
|
||||||
// This file may not be copied, modified, or distributed except according to those terms.
|
// 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)]
|
#![plugin(tarpc_plugins)]
|
||||||
|
|
||||||
#[macro_use]
|
#[macro_use]
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
// Licensed under the MIT License, <LICENSE or http://opensource.org/licenses/MIT>.
|
// Licensed under the MIT License, <LICENSE or http://opensource.org/licenses/MIT>.
|
||||||
// This file may not be copied, modified, or distributed except according to those terms.
|
// 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)]
|
#![plugin(tarpc_plugins)]
|
||||||
|
|
||||||
extern crate chrono;
|
extern crate chrono;
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
// Licensed under the MIT License, <LICENSE or http://opensource.org/licenses/MIT>.
|
// Licensed under the MIT License, <LICENSE or http://opensource.org/licenses/MIT>.
|
||||||
// This file may not be copied, modified, or distributed except according to those terms.
|
// 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)]
|
#![plugin(tarpc_plugins)]
|
||||||
|
|
||||||
extern crate env_logger;
|
extern crate env_logger;
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
// Licensed under the MIT License, <LICENSE or http://opensource.org/licenses/MIT>.
|
// Licensed under the MIT License, <LICENSE or http://opensource.org/licenses/MIT>.
|
||||||
// This file may not be copied, modified, or distributed except according to those terms.
|
// 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)]
|
#![plugin(tarpc_plugins)]
|
||||||
|
|
||||||
#[macro_use]
|
#[macro_use]
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
// Licensed under the MIT License, <LICENSE or http://opensource.org/licenses/MIT>.
|
// Licensed under the MIT License, <LICENSE or http://opensource.org/licenses/MIT>.
|
||||||
// This file may not be copied, modified, or distributed except according to those terms.
|
// 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)]
|
#![plugin(tarpc_plugins)]
|
||||||
|
|
||||||
extern crate futures;
|
extern crate futures;
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
// This file may not be copied, modified, or distributed except according to those terms.
|
// This file may not be copied, modified, or distributed except according to those terms.
|
||||||
|
|
||||||
// required by `FutureClient` (not used directly in this example)
|
// 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)]
|
#![plugin(tarpc_plugins)]
|
||||||
|
|
||||||
#[macro_use]
|
#[macro_use]
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
// Licensed under the MIT License, <LICENSE or http://opensource.org/licenses/MIT>.
|
// Licensed under the MIT License, <LICENSE or http://opensource.org/licenses/MIT>.
|
||||||
// This file may not be copied, modified, or distributed except according to those terms.
|
// 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)]
|
#![plugin(tarpc_plugins)]
|
||||||
|
|
||||||
extern crate env_logger;
|
extern crate env_logger;
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
// Licensed under the MIT License, <LICENSE or http://opensource.org/licenses/MIT>.
|
// Licensed under the MIT License, <LICENSE or http://opensource.org/licenses/MIT>.
|
||||||
// This file may not be copied, modified, or distributed except according to those terms.
|
// 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)]
|
#![plugin(tarpc_plugins)]
|
||||||
|
|
||||||
extern crate env_logger;
|
extern crate env_logger;
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
// Licensed under the MIT License, <LICENSE or http://opensource.org/licenses/MIT>.
|
// Licensed under the MIT License, <LICENSE or http://opensource.org/licenses/MIT>.
|
||||||
// This file may not be copied, modified, or distributed except according to those terms.
|
// 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)]
|
#![plugin(tarpc_plugins)]
|
||||||
|
|
||||||
#[macro_use]
|
#[macro_use]
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
// Licensed under the MIT License, <LICENSE or http://opensource.org/licenses/MIT>.
|
// Licensed under the MIT License, <LICENSE or http://opensource.org/licenses/MIT>.
|
||||||
// This file may not be copied, modified, or distributed except according to those terms.
|
// 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)]
|
#![plugin(tarpc_plugins)]
|
||||||
|
|
||||||
#[macro_use]
|
#[macro_use]
|
||||||
|
|||||||
@@ -27,7 +27,7 @@
|
|||||||
//! Example usage:
|
//! Example usage:
|
||||||
//!
|
//!
|
||||||
//! ```
|
//! ```
|
||||||
//! #![feature(plugin, use_extern_macros)]
|
//! #![feature(plugin, use_extern_macros, proc_macro_path_invoc)]
|
||||||
//! #![plugin(tarpc_plugins)]
|
//! #![plugin(tarpc_plugins)]
|
||||||
//!
|
//!
|
||||||
//! #[macro_use]
|
//! #[macro_use]
|
||||||
@@ -71,7 +71,7 @@
|
|||||||
//! Example usage with TLS:
|
//! Example usage with TLS:
|
||||||
//!
|
//!
|
||||||
//! ```no-run
|
//! ```no-run
|
||||||
//! #![feature(plugin, use_extern_macros)]
|
//! #![feature(plugin, use_extern_macros, proc_macro_path_invoc)]
|
||||||
//! #![plugin(tarpc_plugins)]
|
//! #![plugin(tarpc_plugins)]
|
||||||
//!
|
//!
|
||||||
//! #[macro_use]
|
//! #[macro_use]
|
||||||
@@ -116,7 +116,7 @@
|
|||||||
|
|
||||||
#![deny(missing_docs, missing_debug_implementations)]
|
#![deny(missing_docs, missing_debug_implementations)]
|
||||||
#![feature(never_type)]
|
#![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))]
|
#![cfg_attr(test, plugin(tarpc_plugins))]
|
||||||
|
|
||||||
extern crate byteorder;
|
extern crate byteorder;
|
||||||
@@ -130,6 +130,7 @@ extern crate log;
|
|||||||
extern crate net2;
|
extern crate net2;
|
||||||
extern crate num_cpus;
|
extern crate num_cpus;
|
||||||
extern crate thread_pool;
|
extern crate thread_pool;
|
||||||
|
extern crate tokio_codec;
|
||||||
extern crate tokio_io;
|
extern crate tokio_io;
|
||||||
|
|
||||||
#[doc(hidden)]
|
#[doc(hidden)]
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ macro_rules! as_item {
|
|||||||
/// Rpc methods are specified, mirroring trait syntax:
|
/// Rpc methods are specified, mirroring trait syntax:
|
||||||
///
|
///
|
||||||
/// ```
|
/// ```
|
||||||
/// # #![feature(plugin, use_extern_macros)]
|
/// # #![feature(plugin, use_extern_macros, proc_macro_path_invoc)]
|
||||||
/// # #![plugin(tarpc_plugins)]
|
/// # #![plugin(tarpc_plugins)]
|
||||||
/// # #[macro_use] extern crate tarpc;
|
/// # #[macro_use] extern crate tarpc;
|
||||||
/// # fn main() {}
|
/// # fn main() {}
|
||||||
@@ -657,7 +657,6 @@ mod functional_test {
|
|||||||
fn get_tls_client_context() -> Context {
|
fn get_tls_client_context() -> Context {
|
||||||
let mut connector = unwrap!(TlsConnector::builder());
|
let mut connector = unwrap!(TlsConnector::builder());
|
||||||
unwrap!(connector.builder_mut()
|
unwrap!(connector.builder_mut()
|
||||||
.builder_mut()
|
|
||||||
.set_ca_file("test/root-ca.pem"));
|
.set_ca_file("test/root-ca.pem"));
|
||||||
Context {
|
Context {
|
||||||
domain: DOMAIN.into(),
|
domain: DOMAIN.into(),
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "tarpc-plugins"
|
name = "tarpc-plugins"
|
||||||
version = "0.3.0"
|
version = "0.4.0"
|
||||||
authors = ["Adam Wright <adam.austin.wright@gmail.com>", "Tim Kuehn <timothy.j.kuehn@gmail.com>"]
|
authors = ["Adam Wright <adam.austin.wright@gmail.com>", "Tim Kuehn <timothy.j.kuehn@gmail.com>"]
|
||||||
license = "MIT"
|
license = "MIT"
|
||||||
documentation = "https://docs.rs/tarpc"
|
documentation = "https://docs.rs/tarpc"
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ use itertools::Itertools;
|
|||||||
use rustc_plugin::Registry;
|
use rustc_plugin::Registry;
|
||||||
use syntax::ast::{self, Ident, TraitRef, Ty, TyKind};
|
use syntax::ast::{self, Ident, TraitRef, Ty, TyKind};
|
||||||
use syntax::ext::base::{ExtCtxt, MacResult, DummyResult, MacEager};
|
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::{self, token, str_lit, PResult};
|
||||||
use syntax::parse::parser::{Parser, PathStyle};
|
use syntax::parse::parser::{Parser, PathStyle};
|
||||||
use syntax::symbol::Symbol;
|
use syntax::symbol::Symbol;
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ use std::io;
|
|||||||
use std::marker::PhantomData;
|
use std::marker::PhantomData;
|
||||||
use std::mem;
|
use std::mem;
|
||||||
use tokio_io::{AsyncRead, AsyncWrite};
|
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::multiplex::{ClientProto, ServerProto};
|
||||||
use tokio_proto::streaming::multiplex::RequestId;
|
use tokio_proto::streaming::multiplex::RequestId;
|
||||||
|
|
||||||
@@ -74,9 +74,9 @@ where
|
|||||||
}
|
}
|
||||||
let message_size = 2 * mem::size_of::<u64>() + payload_size as usize;
|
let message_size = 2 * mem::size_of::<u64>() + payload_size as usize;
|
||||||
buf.reserve(message_size);
|
buf.reserve(message_size);
|
||||||
buf.put_u64::<BigEndian>(id);
|
buf.put_u64_be(id);
|
||||||
trace!("Encoded request id = {} as {:?}", id, buf);
|
trace!("Encoded request id = {} as {:?}", id, buf);
|
||||||
buf.put_u64::<BigEndian>(payload_size);
|
buf.put_u64_be(payload_size);
|
||||||
bincode::serialize_into(&mut buf.writer(), &message)
|
bincode::serialize_into(&mut buf.writer(), &message)
|
||||||
.map_err(|serialize_err| {
|
.map_err(|serialize_err| {
|
||||||
io::Error::new(io::ErrorKind::Other, serialize_err)
|
io::Error::new(io::ErrorKind::Other, serialize_err)
|
||||||
@@ -180,7 +180,7 @@ where
|
|||||||
type BindTransport = Result<Self::Transport, io::Error>;
|
type BindTransport = Result<Self::Transport, io::Error>;
|
||||||
|
|
||||||
fn bind_transport(&self, io: T) -> Self::BindTransport {
|
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<Self::Transport, io::Error>;
|
type BindTransport = Result<Self::Transport, io::Error>;
|
||||||
|
|
||||||
fn bind_transport(&self, io: T) -> Self::BindTransport {
|
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)))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user