Comments (6)
You have to manually box applications, something like:
HttpServer::new(|| vec![
Box::new(Application::<State1>::new().finish()),
Box::new(Application::<State2>::new().finish()),
Box::new(Application::<State3>::new().finish())])
maybe application should have convenience method.
from actix-web.
once you box the application, it doesn't implement actix_web::server::HttpHandler
so I don't think this works either
the following trait bounds were not satisfied:
`std::boxed::Box<actix_web::application::HttpApplication<State1>> : actix_web::server::HttpHandler
from actix-web.
you are right! thanks for report
from actix-web.
fixed in master
https://actix.github.io/actix-web/actix_web/struct.Application.html#method.boxed
from actix-web.
error with app with state and no state. such like
vec![ App::new().resource("/test1", |r| r.f(test1)) .boxed(), App::with_state(AppState::default()) .resource("/test2", |r| r.f(test2)) .boxed(),
from actix-web.
@daleione here is example
https://actix.rs/actix-web/actix_web/struct.App.html#method.boxed
from actix-web.
Related Issues (20)
- Call for help with bind_rustls_021 just support one request at the same time HOT 6
- default service not defaulting to the parent scope
- Pending multipart request with angular rxjs HOT 1
- **I want to send the bytes of the playload to the LOG server in the log middleware** HOT 1
- actix-http 3.5 "Prevent compression of zero-sized response bodies" causes delays to close connection HOT 2
- The function app_data of web::ServiceConfig cannot persist HOT 1
- actix-files: Can't handle files with newlines in them
- websocket bug!Cannot complete one websocket client to send a message to another client
- Why is the code below why version 4 cannot access httpserver, but version 3 can? HOT 1
- awc CONNECT method support
- add Proxy-Connection header HOT 3
- Filter out completely impossible characters.
- Add macro for route handler accepting all HTTP methods HOT 13
- Compilation fails when using the latest version of rustls HOT 5
- Add pattern syntax for optional trailing slash
- [How to] Middleware `Response body` manipulation.
- Add support to be able to test the route tree using `match_pattern` and `match_name`. HOT 2
- Connecting to the database from an external network causes a spike in connections HOT 1
- actix-http: Compilation fails HOT 1
- Err(NoWebsocketUpgrade) HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from actix-web.