Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

22 changes: 0 additions & 22 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,28 +68,6 @@ where
}
```

We also provided the `#[motore::service]` macro to make writing a `Serivce` more async-native:

```rust
use motore::service;

pub struct S<I> {
inner: I,
}

#[service]
impl<Cx, Req, I> Service<Cx, Req> for S<I>
where
Req: Send + 'static,
I: Service<Cx, Req> + Send + 'static + Sync,
Cx: Send + 'static,
{
async fn call(&self, cx: &mut Cx, req: Req) -> Result<I::Response, I::Error> {
self.inner.call(cx, req).await
}
}
```

## FAQ

### Where's the `poll_ready`(a.k.a. backpressure)?
Expand Down
2 changes: 1 addition & 1 deletion motore-macros/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "motore-macros"
version = "0.4.3"
version = "0.4.4"
edition = "2021"
description = """
Motore's proc macros.
Expand Down
3 changes: 3 additions & 0 deletions motore-macros/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ use syn::{parse_macro_input, parse_quote, spanned::Spanned, ItemImpl, PatType, T
/// }
/// }
/// ```
#[deprecated(
note = "The `service` macro is no longer needed as `async fn in trait` are now stable. You can write `async fn call` directly in your `Service` implementation without this macro."
)]
#[proc_macro_attribute]
pub fn service(_args: TokenStream, input: TokenStream) -> TokenStream {
let mut item = parse_macro_input!(input as ItemImpl);
Expand Down
2 changes: 1 addition & 1 deletion motore/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "motore"
version = "0.4.2"
version = "0.4.3"
edition = "2021"
description = """
Motore is a library of modular and reusable components for building robust
Expand Down
4 changes: 4 additions & 0 deletions motore/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,9 @@ pub mod make;
pub mod service;
pub mod timeout;
pub mod utils;
#[deprecated(
note = "`async fn in trait` is stable now. You can use `async fn call` directly in your `Service` implementation without this macro."
)]
pub use motore_macros::service;
pub use service::{BoxCloneService, Service, ServiceExt, UnaryService};

Expand All @@ -58,6 +61,7 @@ mod sealed {
mod tests {

#[test]
#[allow(deprecated)]
pub fn test_service_macro() {
pub struct Context;
pub struct Service<S>(S);
Expand Down
Loading