diff --git a/content/docs/application.md b/content/docs/application.md index 71379f4..65874b3 100644 --- a/content/docs/application.md +++ b/content/docs/application.md @@ -60,7 +60,7 @@ In the above example, the `show_users` route will have an effective route patter ## Application guards and virtual hosting -You can think of a guard as a simple function that accepts a _request_ object reference and returns _true_ or _false_. Formally, a guard is any object that implements the [`Guard`][guardtrait] trait. Actix-web provides several guards. You can check the [functions section][guardfuncs] of the API docs. +You can think of a guard as a simple function that accepts a _request_ object reference and returns _true_ or _false_. Formally, a guard is any object that implements the [`Guard`][guardtrait] trait. Actix Web provides several guards. You can check the [functions section][guardfuncs] of the API docs. One of the provided guards is [`Header`][guardheader]. It can be used as a filter based on request header information. diff --git a/content/docs/errors.md b/content/docs/errors.md index e79cee5..b2b1bfd 100644 --- a/content/docs/errors.md +++ b/content/docs/errors.md @@ -6,7 +6,7 @@ weight: 180 # Errors -Actix-web uses its own [`actix_web::error::Error`][actixerror] type and [`actix_web::error::ResponseError`][responseerror] trait for error handling from web handlers. +Actix Web uses its own [`actix_web::error::Error`][actixerror] type and [`actix_web::error::ResponseError`][responseerror] trait for error handling from web handlers. If a handler returns an `Error` (referring to the [general Rust trait `std::error::Error`][stderror]) in a `Result` that also implements the `ResponseError` trait, actix-web will render that error as an HTTP response with its corresponding [`actix_web::http::StatusCode`][status_code]. An internal server error is generated by default: @@ -25,7 +25,7 @@ impl> Responder for Result `Error` in the code above is actix-web's error definition, and any errors that implement `ResponseError` can be converted to one automatically. -Actix-web provides `ResponseError` implementations for some common non-actix errors. For example, if a handler responds with an `io::Error`, that error is converted into an `HttpInternalServerError`: +Actix Web provides `ResponseError` implementations for some common non-actix errors. For example, if a handler responds with an `io::Error`, that error is converted into an `HttpInternalServerError`: ```rust use std::io; @@ -52,7 +52,7 @@ Override `error_response()` to produce more useful results: # Error helpers -Actix-web provides a set of error helper functions that are useful for generating specific HTTP error codes from other errors. Here we convert `MyError`, which doesn't implement the `ResponseError` trait, to a _400_ (bad request) using `map_err`: +Actix Web provides a set of error helper functions that are useful for generating specific HTTP error codes from other errors. Here we convert `MyError`, which doesn't implement the `ResponseError` trait, to a _400_ (bad request) using `map_err`: {{< include-example example="errors" file="helpers.rs" section="helpers" >}} diff --git a/content/docs/extractors.md b/content/docs/extractors.md index 8bbde48..a8b7fcc 100644 --- a/content/docs/extractors.md +++ b/content/docs/extractors.md @@ -6,9 +6,9 @@ weight: 170 # Type-safe information extraction -Actix-web provides a facility for type-safe request information access called _extractors_ (i.e., `impl FromRequest`). By default, actix-web provides several extractor implementations. +Actix Web provides a facility for type-safe request information access called _extractors_ (i.e., `impl FromRequest`). By default, actix-web provides several extractor implementations. -An extractor can be accessed as an argument to a handler function. Actix-web supports up to 12 extractors per handler function. Argument position does not matter. +An extractor can be accessed as an argument to a handler function. Actix Web supports up to 12 extractors per handler function. Argument position does not matter. {{< include-example example="extractors" file="main.rs" section="option-one" >}} @@ -56,7 +56,7 @@ At the moment, only url-encoded forms are supported. The url-encoded body could # Other -Actix-web also provides several other extractors: +Actix Web also provides several other extractors: - [_Data_][datastruct] - If you need access to an application state. - _HttpRequest_ - _HttpRequest_ itself is an extractor which returns self, in case you need access to the request. diff --git a/content/docs/middleware.md b/content/docs/middleware.md index ad0100c..96e6b46 100644 --- a/content/docs/middleware.md +++ b/content/docs/middleware.md @@ -6,7 +6,7 @@ weight: 220 # Middleware -Actix-web's middleware system allows us to add additional behavior to request/response processing. Middleware can hook into an incoming request process, enabling us to modify requests as well as halt request processing to return a response early. +Actix Web's middleware system allows us to add additional behavior to request/response processing. Middleware can hook into an incoming request process, enabling us to modify requests as well as halt request processing to return a response early. Middleware can also hook into response processing. @@ -27,7 +27,7 @@ Alternatively, for simple use cases, you can use [_wrap_fn_][wrap_fn] to create {{< include-example example="middleware" file="wrap_fn.rs" section="wrap-fn" >}} -> Actix-web provides several useful middleware, such as _logging_, _user sessions_, _compress_, etc. +> Actix Web provides several useful middleware, such as _logging_, _user sessions_, _compress_, etc. **Warning: if you use `wrap()` or `wrap_fn()` multiple times, the last occurrence will be executed first.** @@ -77,7 +77,7 @@ To set default response headers, the `DefaultHeaders` middleware can be used. Th ## User sessions -Actix-web provides a general solution for session management. The [**actix-session**][actixsession] middleware can use multiple backend types to store session data. +Actix Web provides a general solution for session management. The [**actix-session**][actixsession] middleware can use multiple backend types to store session data. > By default, only cookie session backend is implemented. Other backend implementations can be added. diff --git a/content/docs/request.md b/content/docs/request.md index adee09c..1664e9c 100644 --- a/content/docs/request.md +++ b/content/docs/request.md @@ -40,7 +40,7 @@ In the following example, we will deserialize a _MyObj_ struct. We need to load # Content Encoding -Actix-web automatically _decompresses_ payloads. The following codecs are supported: +Actix Web automatically _decompresses_ payloads. The following codecs are supported: - Brotli - Gzip @@ -55,13 +55,13 @@ Actix automatically decodes _chunked_ encoding. The [`web::Payload`][payloadextr # Multipart body -Actix-web provides multipart stream support with an external crate, [`actix-multipart`][multipartcrate]. +Actix Web provides multipart stream support with an external crate, [`actix-multipart`][multipartcrate]. > A full example is available in the [examples directory][multipartexample]. # Urlencoded body -Actix-web provides support for _application/x-www-form-urlencoded_ encoded bodies with the [`web::Form`][formencoded] extractor which resolves to the deserialized instance. The type of the instance must implement the `Deserialize` trait from _serde_. +Actix Web provides support for _application/x-www-form-urlencoded_ encoded bodies with the [`web::Form`][formencoded] extractor which resolves to the deserialized instance. The type of the instance must implement the `Deserialize` trait from _serde_. The _UrlEncoded_ future can resolve into an error in several cases: diff --git a/content/docs/response.md b/content/docs/response.md index 9c71b04..e60c6dd 100644 --- a/content/docs/response.md +++ b/content/docs/response.md @@ -31,7 +31,7 @@ Using the `Json` type this way instead of calling the `.json` method on a `HttpR # Content encoding -Actix-web can automatically _compress_ payloads with the [_Compress middleware_][compressmidddleware]. The following codecs are supported: +Actix Web can automatically _compress_ payloads with the [_Compress middleware_][compressmidddleware]. The following codecs are supported: - Brotli - Gzip diff --git a/content/docs/testing.md b/content/docs/testing.md index c7e1a41..d901587 100644 --- a/content/docs/testing.md +++ b/content/docs/testing.md @@ -6,7 +6,7 @@ weight: 215 # Testing -Every application should be well tested. Actix-web provides tools to perform unit and integration tests. +Every application should be well tested. Actix Web provides tools to perform unit and integration tests. # Unit Tests @@ -16,7 +16,7 @@ For unit testing, actix-web provides a request builder type. [_TestRequest_][tes # Integration tests -There are a few methods for testing your application. Actix-web can be used to run the application with specific handlers in a real HTTP server. +There are a few methods for testing your application. Actix Web can be used to run the application with specific handlers in a real HTTP server. `TestRequest::get()`, `TestRequest::post()` and other methods can be used to send requests to the test server. diff --git a/content/docs/websockets.md b/content/docs/websockets.md index 86ea2e6..563f78c 100644 --- a/content/docs/websockets.md +++ b/content/docs/websockets.md @@ -4,7 +4,7 @@ menu: docs_protocols weight: 240 --- -Actix-web supports WebSockets with the `actix-web-actors` crate. It is possible to convert a request's `Payload` to a stream of [_ws::Message_][message] with a [_web::Payload_][payload] and then use stream combinators to handle actual messages, but it is simpler to handle websocket communications with an http actor. +Actix Web supports WebSockets with the `actix-web-actors` crate. It is possible to convert a request's `Payload` to a stream of [_ws::Message_][message] with a [_web::Payload_][payload] and then use stream combinators to handle actual messages, but it is simpler to handle websocket communications with an http actor. The following is an example of a simple websocket echo server: diff --git a/examples/application/src/state.rs b/examples/application/src/state.rs index f45399b..5f34d76 100644 --- a/examples/application/src/state.rs +++ b/examples/application/src/state.rs @@ -19,7 +19,7 @@ async fn main() -> std::io::Result<()> { HttpServer::new(|| { App::new() .app_data(web::Data::new(AppState { - app_name: String::from("Actix-web"), + app_name: String::from("Actix Web"), })) .service(index) })