Skip to content

Commit

Permalink
before cargo fix
Browse files Browse the repository at this point in the history
  • Loading branch information
kardeiz committed Jan 13, 2025
1 parent 9610d65 commit b100b3a
Show file tree
Hide file tree
Showing 9 changed files with 18 additions and 295 deletions.
23 changes: 11 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
# jsonrpc-v2

[![Docs](https://docs.rs/jsonrpc-v2/badge.svg)](https://docs.rs/jsonrpc-v2/)
[![Crates.io](https://img.shields.io/crates/v/jsonrpc-v2.svg)](https://crates.io/crates/jsonrpc-v2)

# jsonrpc-v2

[![Docs](https://docs.rs/jsonrpc-v2/badge.svg)](https://docs.rs/jsonrpc-v2/)
[![Crates.io](https://img.shields.io/crates/v/jsonrpc-v2.svg)](https://crates.io/crates/jsonrpc-v2)

A very small and very fast JSON-RPC 2.0 server-focused framework.

Provides integrations for both `hyper` and `actix-web` (1.x, 2.x, 3.x, 4.x).
Enable features `actix-web-v3-integration`, `hyper-integration`, etc. as needed.
Provides integrations for both `hyper` and `actix-web` (4.x).

`actix-web-v4-integration` is enabled by default. Make sure to add `default-features = false` if using `hyper` or other `actix-web` versions.
`actix-web-v4-integration` is enabled by default. Make sure to add `default-features = false` if using `hyper`.

Also see the `easy-errors` feature flag (not enabled by default). Enabling this flag will implement [`ErrorLike`](https://docs.rs/jsonrpc-v2/*/jsonrpc_v2/trait.ErrorLike.html)
for anything that implements `Display`, and the display value will be provided in the `message` field of the JSON-RPC 2.0 `Error` response.
Expand Down Expand Up @@ -61,8 +60,8 @@ async fn main() -> std::io::Result<()> {
.run()
.await
}
```

Current version: 0.11.0

```

Current version: 0.14.0-beta.0

License: MIT
45 changes: 0 additions & 45 deletions examples/actix-web-v2.rs

This file was deleted.

45 changes: 0 additions & 45 deletions examples/actix-web-v3.rs

This file was deleted.

File renamed without changes.
1 change: 1 addition & 0 deletions src/actix_web.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ use serde::Serialize;

use crate::{Factory, Handler, RequestObjectWithData, Router, Error, BoxedSerialize, FromRequest, Server, ResponseObjects};

/// Wrapper around `actix_web::HttpRequest`
#[derive(Clone)]
pub struct HttpRequest(pub actix_web_v4::HttpRequest);

Expand Down
12 changes: 2 additions & 10 deletions src/factory/mod.rs
Original file line number Diff line number Diff line change
@@ -1,15 +1,7 @@
#[cfg(any(
feature = "actix-web-v2",
feature = "actix-web-v3",
feature = "actix-web-v4"
))]
#[cfg(feature = "actix-web-v4")]
mod actix_web;

#[cfg(any(
feature = "actix-web-v2",
feature = "actix-web-v3",
feature = "actix-web-v4"
))]
#[cfg(feature = "actix-web-v4")]
pub use actix_web::*;

#[cfg(feature = "hyper-integration")]
Expand Down
20 changes: 2 additions & 18 deletions src/hyper.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ use http_body_util::{BodyExt, Full};

use crate::{Factory, Handler, RequestObjectWithData, Router, Error, BoxedSerialize, FromRequest, Server, ResponseObjects};

/// Wrapper around `hyper::http::request::Parts`
#[derive(Clone)]
pub struct HttpRequest(pub hyper::http::request::Parts);

Expand Down Expand Up @@ -110,21 +111,4 @@ where
});
Box::pin(rt)
}
}

// impl<R> tower_service::Service<&'a hyper::server::conn::AddrStream> for Hyper<R> {
// type Response = Hyper<R>;
// type Error = Box<dyn std::error::Error + Send + Sync + 'static>;
// type Future = future::Ready<Result<Self::Response, Self::Error>>;

// fn poll_ready(
// &mut self,
// _cx: &mut std::task::Context<'_>,
// ) -> std::task::Poll<Result<(), Self::Error>> {
// std::task::Poll::Ready(Ok(()))
// }

// fn call(&mut self, _: &'a hyper::server::conn::AddrStream) -> Self::Future {
// future::ready(Ok(Hyper(Arc::clone(&self.0))))
// }
// }
}
162 changes: 0 additions & 162 deletions src/legacy.rs

This file was deleted.

5 changes: 2 additions & 3 deletions src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
/*!
A very small and very fast JSON-RPC 2.0 server-focused framework.
Provides integrations for both `hyper` and `actix-web` (1.x, 2.x, 3.x, 4.x).
Enable features `actix-web-v3-integration`, `hyper-integration`, etc. as needed.
Provides integrations for both `hyper` and `actix-web` (4.x).
`actix-web-v4-integration` is enabled by default. Make sure to add `default-features = false` if using `hyper` or other `actix-web` versions.
`actix-web-v4-integration` is enabled by default. Make sure to add `default-features = false` if using `hyper`.
Also see the `easy-errors` feature flag (not enabled by default). Enabling this flag will implement [`ErrorLike`](https://docs.rs/jsonrpc-v2/&#42;/jsonrpc_v2/trait.ErrorLike.html)
for anything that implements `Display`, and the display value will be provided in the `message` field of the JSON-RPC 2.0 `Error` response.
Expand Down

0 comments on commit b100b3a

Please sign in to comment.