Commit Graph

114 Commits

Author SHA1 Message Date
Rob Ede cf5138e740
fix clippy async_yields_async lints (#1667) 2020-09-11 11:29:17 +01:00
Yuki Okushi 92b5bcd13f
Check format and tweak CI config (#1619) 2020-07-22 00:28:33 +01:00
Yuki Okushi a98e53ecb8
web: Minimize `futures` dependencies 2020-05-19 08:29:12 +09:00
Rob Ede f3b0233477
use mem::take where possible (#1507) 2020-05-17 10:54:42 +09:00
Rob Ede 879cad9422
allow parent data containers to be accessed from child scopes 2020-05-09 00:31:26 +01:00
Rob Ede c27d3fad8e
clarify resource/scope app data overriding (#1476)
* relocate FnDataFactory

* clarify app data overriding in Scope and Resource

Co-authored-by: Yuki Okushi <huyuumi.dev@gmail.com>
2020-04-30 02:20:47 +09:00
Rob Ede 5b0f7fff69
fix spelling errors in doc comments 2020-04-21 04:09:35 +01:00
Rob Ede 45e2e40140
set data container on default service calls
closes #1450
2020-04-14 02:33:19 +01:00
Nikolay Kim e5a50f423d Make web::Data deref to Arc<T> #1214 2019-12-20 17:45:35 +06:00
Nikolay Kim c877840c07 rename App::register_data to App::app_data and HttpRequest::app_data returns Option<&T> instead of Option<&Data<T>> 2019-12-20 17:13:09 +06:00
Nikolay Kim 6c9f9fff73 clippy warnings 2019-12-08 00:46:51 +06:00
Nikolay Kim 068f047dd5 update service factory config 2019-12-02 21:37:13 +06:00
Nikolay Kim 4dc31aac93 use actix_rt::test for test setup 2019-11-26 11:25:50 +06:00
Jim Blandy c5907747ad Remove implementation of Responder for (). Fixes #1108.
Rationale:

- In Rust, one can omit a semicolon after a function's final expression to make
  its value the function's return value. It's common for people to include a
  semicolon after the last expression by mistake - common enough that the Rust
  compiler suggests removing the semicolon when there's a type mismatch between
  the function's signature and body. By implementing Responder for (), Actix makes
  this common mistake a silent error in handler functions.

- Functions returning an empty body should return HTTP status 204 ("No Content"),
  so the current Responder impl for (), which returns status 200 ("OK"), is not
  really what one wants anyway.

- It's not much of a burden to ask handlers to explicitly return
  `HttpResponse::Ok()` if that is what they want; all the examples in the
  documentation do this already.
2019-11-23 21:10:02 +06:00
Nikolay Kim 8683ba8bb0 rename .to_async() to .to() 2019-11-21 21:36:35 +06:00
Nikolay Kim 1f0577f8d5 cleanup api doc examples 2019-11-21 16:02:17 +06:00
Nikolay Kim 3127dd4db6 migrate actix-web to std::future 2019-11-21 16:02:17 +06:00
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
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
Nikolay Kim d293ae2a69 fix nested resource map registration #915 2019-06-15 22:12:20 +06:00
Nikolay Kim 0e138e111f add external resource support on scope level 2019-06-03 23:41:32 +06:00
Denys Vitali 1fce4876f3 Scope configuration (#880)
* WIP: Scope configuarion

* Extensions: Fix into_iter()

* Scope: Fix tests

* Add ScopeConfig to web

Committing from mobile, if this doesn't look good it's because I haven't tested it...

* Scope Config: Use ServiceConfig instead

* Scope: Switch to ServiceConfig in doc

* ScopeConfig: Remove unnecessary changes, handle the case when data is empty

* ScopeConfig: Remove changes from actix-http
2019-06-03 23:12:37 +06: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 70a4c36496 use Error explicitly 2019-04-25 11:14:32 -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 bca31eb7ad remove Deref 2019-04-02 13:35:01 -07:00
Nikolay Kim e282ef7925 return back consuming builder 2019-04-02 12:51:16 -07:00
dowwie 3dd3f7bc92 updated scope wrap doc 2019-04-01 15:10:28 -04:00
dowwie 03dfbdfcdd updated wrap and wrap fn descriptions, still requiring viable examples 2019-04-01 14:52:05 -04:00
Nikolay Kim 1904b01fc0 add content-encoding decompression 2019-03-26 15:14:32 -07:00
Nikolay Kim e18227cc3d add wrap_fn to App and Scope 2019-03-25 13:43:02 -07:00
Nikolay Kim 86a21c956c rename .middleware to .wrap 2019-03-25 13:02:10 -07:00
Nikolay Kim ed322c175e update tests 2019-03-24 16:28:16 -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 eef687ec80 remove unneeded methods 2019-03-07 15:51:24 -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