Skip to content

Commit

Permalink
giant refactor: immutable services and impl traits
Browse files Browse the repository at this point in the history
- use 'impl Future' returns for trait contracts: prevents hidden requirments
- refactor tower design around immutable services: easier to reason and use,
  more natural to use like this, makes it also more clear that user needs to handle state properly,
  prevents state keeping in service when not required and easier to integrate
  with other code bases in ecosystem (e.g. hyper)
  • Loading branch information
glendc committed Nov 15, 2023
1 parent 8498811 commit 7ed2bea
Show file tree
Hide file tree
Showing 110 changed files with 754 additions and 1,711 deletions.
1 change: 0 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

members = [
"tower-async",
"tower-async-bridge",
"tower-async-http",
"tower-async-layer",
"tower-async-service",
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ Tower async was featured as crate of the week in "This week in Rust #505": <http
> type Response = S::Response;
> type Error = S::Error;
>
> async fn call(&mut self, request: Request) -> Result<Self::Response, Self::Error> {
> async fn call(&self, request: Request) -> Result<Self::Response, Self::Error> {
> tokio::time::sleep(self.delay).await;
> self.inner.call(request)
> }
Expand Down
27 changes: 27 additions & 0 deletions justfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
fmt:
cargo fmt --all

sort:
cargo sort --workspace --grouped

lint: fmt sort

check:
cargo check --all --all-targets --all-features

clippy:
cargo clippy --all --all-targets --all-features

clippy-fix:
cargo clippy --fix

doc:
RUSTDOCFLAGS="-D rustdoc::broken-intra-doc-links" cargo doc --all-features --no-deps

hack:
cargo hack check --each-feature --no-dev-deps --workspace

test:
cargo test --all-features

qa: lint check clippy doc hack test
20 changes: 0 additions & 20 deletions tower-async-bridge/CHANGELOG.md

This file was deleted.

51 changes: 0 additions & 51 deletions tower-async-bridge/Cargo.toml

This file was deleted.

25 changes: 0 additions & 25 deletions tower-async-bridge/LICENSE

This file was deleted.

30 changes: 0 additions & 30 deletions tower-async-bridge/README.md

This file was deleted.

71 changes: 0 additions & 71 deletions tower-async-bridge/examples/hyper_async_service.rs

This file was deleted.

Loading

0 comments on commit 7ed2bea

Please sign in to comment.