Repository: capnproto/capnproto-rust (language: rust)

Issue:
Question: should Disconnector be part of capnp_rpc's exports?
I have a function `get_client` which returns a bootstrapped RPC client. I'd also like to return a `capnp_rpc::rpc::Disconnector`, so that the caller of `get_clinet` can run it when required. However, [`Disconnector`](https://github.com/capnproto/capnproto-rust/blob/master/capnp-rpc/src/rpc.rs#L1528) is not exported from the crate at the moment. Is this an oversight? Or am I using it wrong ?


Discussion / hints:

Fix patch:
diff --git a/capnp-rpc/CHANGELOG.md b/capnp-rpc/CHANGELOG.md
index 072e910de..b0eeb18c9 100644
--- a/capnp-rpc/CHANGELOG.md
+++ b/capnp-rpc/CHANGELOG.md
@@ -1,3 +1,7 @@
+## next
+
+- Export Disconnector struct from capnp_rpc (#140)
+
 ## v0.10.0
 - Update to Rust 2018.
 - Update minimum required rustc version to 1.35.
diff --git a/capnp-rpc/src/lib.rs b/capnp-rpc/src/lib.rs
index c35474d33..11abcde3b 100644
--- a/capnp-rpc/src/lib.rs
+++ b/capnp-rpc/src/lib.rs
@@ -56,7 +56,7 @@
 //! });
 //! ```
 //!
-//! For a more complete example, see https://github.com/dwrensha/capnp-rpc-rust/tree/master/examples/calculator
+//! For a more complete example, see https://github.com/capnproto/capnproto-rust/tree/master/capnp-rpc/examples/calculator
 
 
 extern crate capnp;
@@ -72,6 +72,7 @@ use std::cell::{RefCell};
 use std::rc::{Rc};
 
 use crate::task_set::TaskSet;
+pub use crate::rpc::Disconnector;
 
 /// Code generated from [rpc.capnp]
 /// (https://github.com/sandstorm-io/capnproto/blob/master/c%2B%2B/src/capnp/rpc.capnp).


Test patch:
diff --git a/capnp-rpc/test/test.rs b/capnp-rpc/test/test.rs
index cef3f775e..017416c57 100644
--- a/capnp-rpc/test/test.rs
+++ b/capnp-rpc/test/test.rs
@@ -137,7 +137,7 @@ fn disconnector_disconnects() {
     let (mut client_rpc_system, server_rpc_system) = disconnector_setup(&handle);
 
     let client: test_capnp::bootstrap::Client = client_rpc_system.bootstrap(rpc_twoparty_capnp::Side::Server);
-    let disconnector = client_rpc_system.get_disconnector();
+    let disconnector: capnp_rpc::Disconnector<capnp_rpc::rpc_twoparty_capnp::Side> = client_rpc_system.get_disconnector();
 
     handle.spawn(client_rpc_system.map_err(|e| {println!("RpcSystem error: {:?}", e); ()}));