Drop jsonrpc_core::Error

This commit is contained in:
Tomasz Drwięga
2017-11-14 11:38:17 +01:00
parent 7e512c637a
commit f7fa9f6e9d
50 changed files with 616 additions and 634 deletions

View File

@@ -18,7 +18,7 @@
use std::collections::BTreeMap;
use jsonrpc_core::BoxFuture;
use futures::Future;
use hyper;
#[derive(Debug, PartialEq, Default, Clone)]
@@ -47,7 +47,7 @@ pub struct EndpointInfo {
}
pub type Endpoints = BTreeMap<String, Box<Endpoint>>;
pub type Response = BoxFuture<hyper::Response, hyper::Error>;
pub type Response = Box<Future<Item=hyper::Response, Error=hyper::Error> + Send>;
pub type Request = hyper::Request;
pub trait Endpoint : Send + Sync {

View File

@@ -24,7 +24,6 @@ use fetch::{self, Fetch};
use futures::sync::oneshot;
use futures::{self, Future};
use hyper::{self, Method, StatusCode};
use jsonrpc_core::BoxFuture;
use parking_lot::Mutex;
use endpoint::{self, EndpointPath};
@@ -212,7 +211,7 @@ impl Errors {
enum FetchState {
Error(ContentHandler),
InProgress(BoxFuture<FetchState, ()>),
InProgress(Box<Future<Item=FetchState, Error=()> + Send>),
Streaming(hyper::Response),
Done(local::Dapp, endpoint::Response),
Empty,
@@ -289,7 +288,7 @@ impl ContentFetcherHandler {
path: EndpointPath,
errors: Errors,
installer: H,
) -> BoxFuture<FetchState, ()> {
) -> Box<Future<Item=FetchState, Error=()> + Send> {
// Start fetching the content
let fetch2 = fetch.clone();
let future = fetch.fetch_with_abort(url, abort.into()).then(move |result| {

View File

@@ -32,7 +32,6 @@ extern crate serde_json;
extern crate unicase;
extern crate zip;
extern crate jsonrpc_core;
extern crate jsonrpc_http_server;
extern crate ethcore_util as util;
@@ -52,10 +51,12 @@ extern crate log;
#[macro_use]
extern crate serde_derive;
#[cfg(test)]
extern crate env_logger;
#[cfg(test)]
extern crate ethcore_devtools as devtools;
#[cfg(test)]
extern crate env_logger;
extern crate jsonrpc_core;
#[cfg(test)]
extern crate parity_reactor;

View File

@@ -14,8 +14,7 @@
// You should have received a copy of the GNU General Public License
// along with Parity. If not, see <http://www.gnu.org/licenses/>.
use std::env;
use std::str;
use std::{env, io, str};
use std::net::SocketAddr;
use std::path::{Path, PathBuf};
use std::sync::Arc;
@@ -187,7 +186,7 @@ impl<T: Fetch> ServerBuilder<T> {
/// Asynchronously start server with no authentication,
/// returns result with `Server` handle on success or an error.
pub fn start_unsecured_http(self, addr: &SocketAddr, io: IoHandler) -> Result<Server, http::Error> {
pub fn start_unsecured_http(self, addr: &SocketAddr, io: IoHandler) -> io::Result<Server> {
let fetch = self.fetch_client();
Server::start_http(
addr,
@@ -234,7 +233,7 @@ impl Server {
remote: Remote,
fetch: F,
serve_ui: bool,
) -> Result<Server, http::Error> {
) -> io::Result<Server> {
let health = NodeHealth::new(
sync_status.clone(),
TimeChecker::new::<String>(&[], CpuPool::new(1)),