Commit Graph

179 Commits

Author SHA1 Message Date
Nikolay Kim d9af8f66ba Use actix-testing for testing utils 2019-09-25 10:28:41 +06:00
Jim Blandy 58c7065f08 Implement `register_data` method on `Resource` and `Scope`. (#1094)
* Implement `register_data` method on `Resource` and `Scope`.

* Split Scope::register_data tests out from Scope::data tests.

* CHANGES.md: Mention {Scope,Resource}::register_data.
2019-09-18 06:36:39 +06:00
Yuki Okushi 23d768a77b
Add explicit `dyn`s (#1041)
* Add explicit `dyn`s

* Remove unnecessary lines
2019-08-17 02:45:44 +09:00
Nikolay Kim 2a2d7f5768 nightly clippy warnings 2019-07-17 15:53:51 +06:00
Ravi Shankar 32718b7e31 Expose factory traits and some clippy fixes (#983) 2019-07-17 12:58:42 +06:00
Nikolay Kim 7b1dcaffda cleanup deprecation warning for Box<dyn> 2019-07-17 11:44:39 +06:00
Cameron Dershem c0c71f82c0 Fixes typo. (#940)
Small typo fix.
2019-06-25 23:23:36 +06:00
Nikolay Kim e1ff3bf8fa fix resource match with params #841 2019-05-15 10:31:40 -07:00
Nikolay Kim 45c05978b0 Allow to set/override app data on scope level 2019-05-12 09:42:05 -07:00
Nikolay Kim df08baf67f update actix-net dependencies 2019-05-12 08:34:51 -07:00
Nikolay Kim fa78da8156 unify route and app data, it allows to provide global extractor config #775 2019-05-04 19:43:49 -07:00
Nikolay Kim 48bee55087 .to_async() handler can return Responder type #792 2019-04-22 14:22:08 -07:00
Nikolay Kim 7a28b32f6d Rename test::call_success to test::call_service 2019-04-15 07:44:07 -07:00
Nikolay Kim 09cdf1e302 Rename RouterConfig to ServiceConfig 2019-04-15 07:32:49 -07:00
Nikolay Kim 5bd5651faa Allow to use any service as default service 2019-04-13 22:25:00 -07:00
Nikolay Kim 4f30fa9d46 Remove generic type for request payload, always use default 2019-04-13 14:50:54 -07:00
Nikolay Kim aa78565453 use objects pool for HttpRequest; optimize nested services call 2019-04-07 23:06:21 -07:00
Nikolay Kim ab45974e35 add default handler 2019-03-31 18:19:18 -07:00
Nikolay Kim 1904b01fc0 add content-encoding decompression 2019-03-26 15:14:32 -07:00
Nikolay Kim 8d1195d8ac add async handler tests 2019-03-25 14:33:34 -07:00
Nikolay Kim 86a21c956c rename .middleware to .wrap 2019-03-25 13:02:10 -07:00
Nikolay Kim 939d2e745c rename Resource::middleware to Resource::wrap and add wrap_fn for fn middlewares 2019-03-25 12:47:58 -07:00
Nikolay Kim ffb3324129 do not use default resource from app, return 405 if no matching route found 2019-03-24 16:15:34 -07:00
Nikolay Kim 4a4826b23a cleanup doc strings and clippy warnings 2019-03-16 21:35:02 -07:00
Nikolay Kim 4d96abb639 use actix_web::Error for middleware errors 2019-03-10 16:35:38 -07:00
Nikolay Kim 54678308d0 propogate app config with http request; add tests for url_for 2019-03-09 14:06:24 -08:00
Nikolay Kim fde55ffa14 revert generic request parameter for service; support ServerConfig as new factory config 2019-03-09 09:49:11 -08:00
Nikolay Kim aadcdaa3d6 add resource map, it allow to check if router has resource and it allows to generate urls for named resources 2019-03-09 07:39:34 -08:00
Nikolay Kim 0e57b4ad61 export extractor configs via web module 2019-03-07 14:01:52 -08:00
Nikolay Kim 60c048c8cd fix nested resources 2019-03-06 19:27:18 -08:00
Nikolay Kim 244fff9e0a added Logger middleware 2019-03-06 19:19:27 -08:00
Nikolay Kim fe22e83144 refactor service registration process; unify services and resources 2019-03-06 15:47:15 -08:00
Nikolay Kim 03248028a9 update actix-service 2019-03-05 10:08:08 -08:00
Nikolay Kim b6fe1dacf2 update middleware impl 2019-03-04 21:42:51 -08:00
Nikolay Kim 360082f99f update api docs 2019-03-03 14:45:56 -08:00
Nikolay Kim e50d4c5e0e rename extractor module to extract, re-enable doc tests 2019-03-03 13:53:31 -08:00
Nikolay Kim 237677be15 rename filter to guard 2019-03-03 12:09:38 -08:00
Nikolay Kim 6df85e32df added extractor configuration system 2019-03-03 00:57:48 -08:00
Nikolay Kim 8103d33270 use custom request for FromRequest trait 2019-03-02 19:19:56 -08:00
Nikolay Kim e6d04d24cc move fs to separate crate 2019-03-01 23:59:44 -08:00
Nikolay Kim 2d7293aaf8 copy actix-web2 2019-03-01 22:51:32 -08:00
Nikolay Kim eb1e9a785f allow to use fn with multiple arguments with .with()/.with_async() 2018-08-16 20:29:06 -07:00
Nikolay Kim da915972c0 refactor router 2018-07-15 16:25:56 +06:00
Nikolay Kim b8b90d9ec9 rename ResourceHandler to Resource 2018-07-12 15:30:01 +06:00
Nikolay Kim 6fd686ef98 cleanup warnings 2018-07-04 21:01:27 +06:00
Nikolay Kim fec6047ddc refactor HttpRequest mutability 2018-07-02 23:35:32 +06:00
Nikolay Kim 65ca563579 use read only self for Middleware 2018-06-21 23:06:23 +06:00
Nikolay Kim 3de9284592 Handler::handle uses &self instead of mutabble reference 2018-06-21 17:07:54 +06:00
Nikolay Kim a69c1e3de5 remove unsafe from scope impl 2018-06-19 23:46:58 +06:00
Josh Leeb-du Toit 9c9eb62031 Update Middleware trait to use `&mut self` 2018-06-02 16:47:18 +10:00
Pascal Hertleif d912bf8771 Add more docs to ResourceHandler API 2018-06-02 00:57:24 +02:00
Pascal Hertleif f414a491dd Fix some ResourceHandler docs
Re-enables code blocks as doc tests to prevent them failing in the
future.
2018-06-02 00:57:07 +02:00
Nikolay Kim c8930b7b6b fix rustfmt formatting 2018-06-01 10:27:23 -07:00
Nikolay Kim 3f5a39a5b7 cargo fmt 2018-06-01 09:37:14 -07:00
Nikolay Kim 45e9aaa462 rustfmt 0.7 2018-05-17 12:20:20 -07:00
Nikolay Kim 18575ee1ee Add Router::with_async() method for async handler registration 2018-05-09 16:27:31 -07:00
Nikolay Kim acd7380865 rename Reply to a AsyncResult 2018-05-03 16:22:08 -07:00
Nikolay Kim 8d65468c58 refactor FromRequest trait 2018-05-01 17:19:15 -07:00
Nikolay Kim ab4e889f96 add middleware finished handler for route middleware 2018-04-29 20:50:38 -07:00
Nikolay Kim c72d1381a6 clippy warnings 2018-04-29 09:09:08 -07:00
Nikolay Kim de49796fd1 clippy warnings; fmt 2018-04-28 22:55:47 -07:00
Nikolay Kim 113f5ad1a8 add rustfmt config 2018-04-13 16:02:01 -07:00
Nikolay Kim be288fa00a for NamedFile process etag and last modified only if status code is 200 2018-04-10 10:57:53 -07:00
Nikolay Kim df21892b5b added extractor configuration 2018-04-03 22:06:18 -07:00
Nikolay Kim 17c27ef42d HttpRequest::resource() returns current matched resource 2018-04-01 17:37:22 -07:00
Nikolay Kim 8791c0f880 simplify With handlers 2018-03-31 09:58:33 -07:00
Nikolay Kim 3ee228005d rename Application 2018-03-31 00:16:55 -07:00
Nikolay Kim 44e3df82f6 simplify http response construction; deprecate httpcodes 2018-03-30 23:07:33 -07:00
Nikolay Kim 9e751de707 re-arrange modules and exports 2018-03-30 17:31:18 -07:00
Nikolay Kim 86dd732704 use FromRequest instead of HttpRequestExtractor 2018-03-29 13:12:28 -07:00
Nikolay Kim 65700281e8 add support for multiple extractors 2018-03-28 14:24:32 -07:00
Nikolay Kim 4358da9926 refactor WithHandler trait 2018-03-27 20:33:24 -07:00
Nikolay Kim 2f60a4b89d add handler with exatractor 2018-03-26 23:10:31 -07:00
Nikolay Kim e2107ec6f4 use small vec on hot path 2018-03-09 08:00:44 -08:00
Nikolay Kim 4e13505b92 rename .p to a .filter 2018-03-01 18:42:50 -08:00
Alexander Andreev e1d9c3803b spelling check 2018-01-16 00:47:25 +03:00
Nikolay Kim e8412672a2 add resource level middlewares support 2018-01-09 20:00:18 -08:00
Nikolay Kim cf8c2ca95e refactor Handler trait, use mut self 2017-12-26 09:00:45 -08:00
Nikolay Kim 79f047f5be remove box from predicates 2017-12-20 13:23:50 -08:00
Nikolay Kim 7fc7d6e17a update guide 2017-12-19 22:36:06 -08:00
Nikolay Kim c98d320f8c rename FromRequest trait to Responder 2017-12-14 09:43:42 -08:00
Nikolay Kim 007b7ce62f unify route not found handling 2017-12-11 16:26:51 -08:00
Nikolay Kim 0f75d066f2 simplify Application creation; update url dispatch guide section 2017-12-11 14:16:29 -08:00
Nikolay Kim 968f5d39d6 added external resources; refactor route recognizer 2017-12-07 16:22:26 -08:00
Nikolay Kim 0dd27bd224 added HttpRequest::url_for 2017-12-06 16:26:27 -08:00
Nikolay Kim c63f058647 simplify application creation 2017-12-06 11:00:39 -08:00
Nikolay Kim 87c7441f7d remove Applicaiton::route, resource is enough 2017-12-06 08:03:08 -08:00
Nikolay Kim a83d9b24ae extrat elements of path pattern 2017-12-05 11:31:35 -08:00
Nikolay Kim f4e9fc7b6a rename async to a 2017-12-04 16:09:22 -08:00
Nikolay Kim e332c1242f use Route for Applicaiton handlers 2017-12-04 14:53:40 -08:00
Nikolay Kim f5d6179a34 renamed Route::handler to Route::f, added Route::h to register Handler 2017-12-04 14:07:53 -08:00
Nikolay Kim 3bf3738e65 introduce route predicates 2017-12-04 13:32:05 -08:00
Nikolay Kim 61744b68a1 introduce custom FromRequest traint for conversion into Reply 2017-12-02 16:37:21 -08:00
Nikolay Kim c3a0a4457a add appl builder async method; add async handler section 2017-12-01 21:58:19 -08:00
Nikolay Kim 07cc017320 make Task private 2017-11-30 15:13:56 -08:00
Nikolay Kim 6e138bf373 refactor streaming responses 2017-11-30 14:42:20 -08:00
Nikolay Kim 427566b90d export Handler 2017-11-29 13:41:51 -08:00
Nikolay Kim 16ceb741b8 refactor RouteHandler trait 2017-11-29 13:26:55 -08:00
Nikolay Kim 6f833798c7 refactor http actor handling 2017-11-29 10:31:24 -08:00
Nikolay Kim 6177d86d97 refactor handler rtype handling 2017-11-29 09:17:00 -08:00