Enum actix_cors::CorsError [−][src]
#[non_exhaustive]
+CorsError in actix_cors - Rust Enum actix_cors::CorsError [−][src]
#[non_exhaustive]
pub enum CorsError {
WildcardOrigin,
MissingOrigin,
@@ -25,8 +25,8 @@ pub enum CorsError {
🔬 This is a nightly-only experimental API. (backtrace
)Returns a stack backtrace, if available, of where this error occurred. Read more
👎 Deprecated since 1.42.0: use the Display impl or to_string()
Auto Trait Implementations
impl RefUnwindSafe for CorsError
impl UnwindSafe for CorsError
Blanket Implementations
Mutably borrows from an owned value. Read more
diff --git a/actix_cors/struct.Cors.html b/actix_cors/struct.Cors.html index a5cae94aa..d40ddc24a 100644 --- a/actix_cors/struct.Cors.html +++ b/actix_cors/struct.Cors.html @@ -20,12 +20,12 @@ server will fail to start up or serve requests. .max_age(3600); // `cors` can now be used in `App::wrap`.Implementations
A very permissive set of default for quick development. Not recommended for production use.
+Implementations
A very permissive set of default for quick development. Not recommended for production use.
All origins, methods, request headers and exposed headers allowed. Credentials supported. Max age 1 hour. Does not send wildcard.
Resets allowed origin list to a state where any origin is accepted.
See Cors::allowed_origin
for more info on allowed origins.
Add an origin that is allowed to make requests.
+Add an origin that is allowed to make requests.
By default, requests from all origins are accepted by CORS logic. This method allows to
specify a finite set of origins to verify the value of the Origin
request header.
These are origin-or-null
types in the Fetch Standard.
*
). Cors::send_wildcard
should be used instead.pub fn allowed_origin_fn<F>(self, f: F) -> Cors where
F: Fn(&HeaderValue, &RequestHead) -> bool + 'static,
pub fn allowed_origin_fn<F>(self, f: F) -> Cors where
F: Fn(&HeaderValue, &RequestHead) -> bool + 'static,
Determinate allowed origins by processing requests which didn’t match any origins specified +
pub fn allowed_origin_fn<F>(self, f: F) -> Cors where
F: Fn(&HeaderValue, &RequestHead) -> bool + 'static,
pub fn allowed_origin_fn<F>(self, f: F) -> Cors where
F: Fn(&HeaderValue, &RequestHead) -> bool + 'static,
Determinate allowed origins by processing requests which didn’t match any origins specified
in the allowed_origin
.
The function will receive two parameters, the Origin header value, and the RequestHead
of
each request, which can be used to determine whether to allow the request or not.
If the function returns true
, the client’s Origin
request header will be echoed back
into the Access-Control-Allow-Origin
response header.
Resets allowed methods list to all methods.
+Resets allowed methods list to all methods.
See Cors::allowed_methods
for more info on allowed methods.
Set a list of methods which allowed origins can perform.
+Set a list of methods which allowed origins can perform.
These will be sent in the Access-Control-Allow-Methods
response header as specified in
the Fetch Standard CORS protocol.
Defaults to [GET, HEAD, POST, OPTIONS, PUT, PATCH, DELETE]
Resets allowed request header list to a state where any header is accepted.
+Resets allowed request header list to a state where any header is accepted.
See Cors::allowed_headers
for more info on allowed request headers.
pub fn allowed_header<H>(self, header: H) -> Cors where
H: TryInto<HeaderName>,
<H as TryInto<HeaderName>>::Error: Into<HttpError>,
pub fn allowed_header<H>(self, header: H) -> Cors where
H: TryInto<HeaderName>,
<H as TryInto<HeaderName>>::Error: Into<HttpError>,
Add an allowed request header.
+pub fn allowed_header<H>(self, header: H) -> Cors where
H: TryInto<HeaderName>,
<H as TryInto<HeaderName>>::Error: Into<HttpError>,
pub fn allowed_header<H>(self, header: H) -> Cors where
H: TryInto<HeaderName>,
<H as TryInto<HeaderName>>::Error: Into<HttpError>,
Add an allowed request header.
See Cors::allowed_headers
for more info on allowed request headers.
pub fn allowed_headers<U, H>(self, headers: U) -> Cors where
U: IntoIterator<Item = H>,
H: TryInto<HeaderName>,
<H as TryInto<HeaderName>>::Error: Into<HttpError>,
pub fn allowed_headers<U, H>(self, headers: U) -> Cors where
U: IntoIterator<Item = H>,
H: TryInto<HeaderName>,
<H as TryInto<HeaderName>>::Error: Into<HttpError>,
Set a list of request header field names which can be used when this resource is accessed by +
pub fn allowed_headers<U, H>(self, headers: U) -> Cors where
U: IntoIterator<Item = H>,
H: TryInto<HeaderName>,
<H as TryInto<HeaderName>>::Error: Into<HttpError>,
pub fn allowed_headers<U, H>(self, headers: U) -> Cors where
U: IntoIterator<Item = H>,
H: TryInto<HeaderName>,
<H as TryInto<HeaderName>>::Error: Into<HttpError>,
Set a list of request header field names which can be used when this resource is accessed by allowed origins.
If All
is set, whatever is requested by the client in Access-Control-Request-Headers
will be echoed back in the Access-Control-Allow-Headers
header as specified in
the Fetch Standard CORS protocol.
Defaults to All
.
Resets exposed response header list to a state where any header is accepted.
+Resets exposed response header list to a state where any header is accepted.
See Cors::expose_headers
for more info on exposed response headers.
pub fn expose_headers<U, H>(self, headers: U) -> Cors where
U: IntoIterator<Item = H>,
H: TryInto<HeaderName>,
<H as TryInto<HeaderName>>::Error: Into<HttpError>,
pub fn expose_headers<U, H>(self, headers: U) -> Cors where
U: IntoIterator<Item = H>,
H: TryInto<HeaderName>,
<H as TryInto<HeaderName>>::Error: Into<HttpError>,
Set a list of headers which are safe to expose to the API of a CORS API specification. +
pub fn expose_headers<U, H>(self, headers: U) -> Cors where
U: IntoIterator<Item = H>,
H: TryInto<HeaderName>,
<H as TryInto<HeaderName>>::Error: Into<HttpError>,
pub fn expose_headers<U, H>(self, headers: U) -> Cors where
U: IntoIterator<Item = H>,
H: TryInto<HeaderName>,
<H as TryInto<HeaderName>>::Error: Into<HttpError>,
Set a list of headers which are safe to expose to the API of a CORS API specification.
This corresponds to the Access-Control-Expose-Headers
response header as specified in
the Fetch Standard CORS protocol.
This defaults to an empty set.
-Set a maximum time (in seconds) for which this CORS request maybe cached. +
Set a maximum time (in seconds) for which this CORS request maybe cached.
This value is set as the Access-Control-Max-Age
header as specified in
the Fetch Standard CORS protocol.
Pass a number (of seconds) or use None to disable sending max age header.
-Set to use wildcard origins.
+Set to use wildcard origins.
If send wildcard is set and the allowed_origins
parameter is All
, a wildcard
Access-Control-Allow-Origin
response header is sent, rather than the request’s
Origin
header.
allow_credentials
set to true
. Depending on the mode of usage, this will either result
in an CorsError::CredentialsWithWildcardOrigin
error during actix launch or runtime.
Defaults to false
.
Allows users to make authenticated requests
+Allows users to make authenticated requests
If true, injects the Access-Control-Allow-Credentials
header in responses. This allows
cookies and credentials to be submitted across domains as specified in
the Fetch Standard CORS protocol.
Defaults to false
.
A server initialization error will occur if credentials are allowed, but the Origin is set
to send wildcards (*
); this is not allowed by the CORS protocol.
Disable Vary
header support.
Disable Vary
header support.
When enabled the header Vary: Origin
will be returned as per the Fetch Standard
implementation guidelines.
Setting this header when the Access-Control-Allow-Origin
is dynamically generated
(eg. when there is more than one allowed origin, and an Origin other than ‘*’ is returned)
informs CDNs and other caches that the CORS headers are dynamic, and cannot be cached.
By default, Vary
header support is enabled.
Disable support for preflight requests.
+Disable support for preflight requests.
When enabled CORS middleware automatically handles OPTIONS
requests.
This is useful for application level middleware.
By default preflight support is enabled.
Trait Implementations
type Response = ServiceResponse
type Response = ServiceResponse
Responses produced by the service.
+type Response = ServiceResponse
type Response = ServiceResponse
Responses produced by the service.
type Error = Error
type Error = Error
Errors produced by the service.
type Transform = CorsMiddleware<S>
type Transform = CorsMiddleware<S>
The TransformService
value created by this factory
type Future = Ready<Result<Self::Transform, Self::InitError>>
type Future = Ready<Result<Self::Transform, Self::InitError>>
The future response value.
-Creates and returns a new Transform component, asynchronously
+Creates and returns a new Transform component, asynchronously
Auto Trait Implementations
impl !RefUnwindSafe for Cors
impl !UnwindSafe for Cors
Blanket Implementations
Mutably borrows from an owned value. Read more
diff --git a/actix_identity/struct.IdentityService.html b/actix_identity/struct.IdentityService.html index ae9314dd3..6d46e5b9a 100644 --- a/actix_identity/struct.IdentityService.html +++ b/actix_identity/struct.IdentityService.html @@ -1,4 +1,4 @@ -Struct actix_identity::IdentityService [−][src]
pub struct IdentityService<T> { /* fields omitted */ }
Expand description
Request identity middleware
+Struct actix_identity::IdentityService [−][src]
pub struct IdentityService<T> { /* fields omitted */ }
Expand description
Request identity middleware
use actix_web::App;
use actix_identity::{CookieIdentityPolicy, IdentityService};
@@ -11,13 +11,13 @@
let app = App::new()
// wrap policy into identity middleware
.wrap(IdentityService::new(policy));
Implementations
Trait Implementations
impl<S, T, B> Transform<S, ServiceRequest> for IdentityService<T> where
S: Service<ServiceRequest, Response = ServiceResponse<B>, Error = Error> + 'static,
S::Future: 'static,
T: IdentityPolicy,
B: MessageBody + 'static,
B::Error: StdError,
impl<S, T, B> Transform<S, ServiceRequest> for IdentityService<T> where
S: Service<ServiceRequest, Response = ServiceResponse<B>, Error = Error> + 'static,
S::Future: 'static,
T: IdentityPolicy,
B: MessageBody + 'static,
B::Error: StdError,
type Response = ServiceResponse
type Response = ServiceResponse
Responses produced by the service.
+Implementations
Trait Implementations
impl<S, T, B> Transform<S, ServiceRequest> for IdentityService<T> where
S: Service<ServiceRequest, Response = ServiceResponse<B>, Error = Error> + 'static,
S::Future: 'static,
T: IdentityPolicy,
B: MessageBody + 'static,
B::Error: StdError,
impl<S, T, B> Transform<S, ServiceRequest> for IdentityService<T> where
S: Service<ServiceRequest, Response = ServiceResponse<B>, Error = Error> + 'static,
S::Future: 'static,
T: IdentityPolicy,
B: MessageBody + 'static,
B::Error: StdError,
type Response = ServiceResponse
type Response = ServiceResponse
Responses produced by the service.
type Error = Error
type Error = Error
Errors produced by the service.
type Transform = IdentityServiceMiddleware<S, T>
type Transform = IdentityServiceMiddleware<S, T>
The TransformService
value created by this factory
type Future = Ready<Result<Self::Transform, Self::InitError>>
type Future = Ready<Result<Self::Transform, Self::InitError>>
The future response value.
-Creates and returns a new Transform component, asynchronously
+Creates and returns a new Transform component, asynchronously
Auto Trait Implementations
impl<T> !RefUnwindSafe for IdentityService<T>
impl<T> !Send for IdentityService<T>
impl<T> !Sync for IdentityService<T>
impl<T> Unpin for IdentityService<T>
impl<T> UnwindSafe for IdentityService<T> where
T: RefUnwindSafe,
Blanket Implementations
Mutably borrows from an owned value. Read more
diff --git a/actix_protobuf/enum.ProtoBufPayloadError.html b/actix_protobuf/enum.ProtoBufPayloadError.html index 85b181aae..657de9781 100644 --- a/actix_protobuf/enum.ProtoBufPayloadError.html +++ b/actix_protobuf/enum.ProtoBufPayloadError.html @@ -1,4 +1,4 @@ -Enum actix_protobuf::ProtoBufPayloadError [−][src]
pub enum ProtoBufPayloadError {
+ProtoBufPayloadError in actix_protobuf - Rust Enum actix_protobuf::ProtoBufPayloadError [−][src]
pub enum ProtoBufPayloadError {
Overflow,
ContentType,
Serialize(ProtoBufEncodeError),
@@ -9,11 +9,11 @@
Serialize error
Tuple Fields of Serialize
Deserialize error
Tuple Fields of Deserialize
Payload error
-Trait Implementations
Performs the conversion.
-
Performs the conversion.
-
Creates full response for error. Read more
+Trait Implementations
Performs the conversion.
+
Performs the conversion.
+
Creates full response for error. Read more
fn status_code(&self) -> StatusCode
Returns appropriate status code for error. Read more
Auto Trait Implementations
impl !RefUnwindSafe for ProtoBufPayloadError
impl Send for ProtoBufPayloadError
impl Sync for ProtoBufPayloadError
impl Unpin for ProtoBufPayloadError
impl !UnwindSafe for ProtoBufPayloadError
Blanket Implementations
Immutably borrows from an owned value. Read more
diff --git a/actix_protobuf/index.html b/actix_protobuf/index.html
index 3b46d4927..e3bc5a292 100644
--- a/actix_protobuf/index.html
+++ b/actix_protobuf/index.html
@@ -1,4 +1,4 @@
-actix_protobuf - Rust Crate actix_protobuf[−][src]
Structs
+actix_protobuf - Rust Crate actix_protobuf[−][src]
Structs
Enums
Traits
diff --git a/actix_protobuf/struct.ProtoBuf.html b/actix_protobuf/struct.ProtoBuf.html
index b7145ad18..50612b94b 100644
--- a/actix_protobuf/struct.ProtoBuf.html
+++ b/actix_protobuf/struct.ProtoBuf.html
@@ -1,15 +1,15 @@
-ProtoBuf in actix_protobuf - Rust Struct actix_protobuf::ProtoBuf [−][src]
pub struct ProtoBuf<T: Message>(pub T);
Tuple Fields
0: T
Trait Implementations
type Config = ProtoBufConfig
Configuration for this extractor.
+ProtoBuf in actix_protobuf - Rust Struct actix_protobuf::ProtoBuf [−][src]
pub struct ProtoBuf<T: Message>(pub T);
Tuple Fields
0: T
Trait Implementations
type Config = ProtoBufConfig
Configuration for this extractor.
type Error = Error
The associated error which can be returned.
Create a Self from request parts asynchronously.
+
Create a Self from request parts asynchronously.
Convert self to HttpResponse
.
+
Convert self to HttpResponse
.
fn with_status(self, status: StatusCode) -> CustomResponder<Self>
Override a status code for a Responder. Read more
fn with_header<H>(self, header: H) -> CustomResponder<Self> where
H: IntoHeaderPair,
Insert header to the final response. Read more
Auto Trait Implementations
impl<T> RefUnwindSafe for ProtoBuf<T> where
T: RefUnwindSafe,
impl<T> UnwindSafe for ProtoBuf<T> where
T: UnwindSafe,
Blanket Implementations
Gets the TypeId
of self
. Read more
diff --git a/actix_protobuf/struct.ProtoBufConfig.html b/actix_protobuf/struct.ProtoBufConfig.html
index 929f5d768..ff8415ac1 100644
--- a/actix_protobuf/struct.ProtoBufConfig.html
+++ b/actix_protobuf/struct.ProtoBufConfig.html
@@ -1,5 +1,5 @@
-ProtoBufConfig in actix_protobuf - Rust Struct actix_protobuf::ProtoBufConfig [−][src]
pub struct ProtoBufConfig { /* fields omitted */ }
Implementations
Trait Implementations
Returns the “default value” for a type. Read more
+ProtoBufConfig in actix_protobuf - Rust Struct actix_protobuf::ProtoBufConfig [−][src]
pub struct ProtoBufConfig { /* fields omitted */ }
Implementations
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for ProtoBufConfig
impl Send for ProtoBufConfig
impl Sync for ProtoBufConfig
impl Unpin for ProtoBufConfig
impl UnwindSafe for ProtoBufConfig
Blanket Implementations
Mutably borrows from an owned value. Read more
diff --git a/actix_protobuf/struct.ProtoBufMessage.html b/actix_protobuf/struct.ProtoBufMessage.html
index b50618f10..9247a917d 100644
--- a/actix_protobuf/struct.ProtoBufMessage.html
+++ b/actix_protobuf/struct.ProtoBufMessage.html
@@ -1,7 +1,7 @@
-ProtoBufMessage in actix_protobuf - Rust Struct actix_protobuf::ProtoBufMessage [−][src]
Implementations
Trait Implementations
type Output = Result<T, ProtoBufPayloadError>
The type of value produced on completion.
-
Attempt to resolve the future to a final value, registering
+
ProtoBufMessage in actix_protobuf - Rust Struct actix_protobuf::ProtoBufMessage [−][src]
Implementations
Trait Implementations
type Output = Result<T, ProtoBufPayloadError>
The type of value produced on completion.
+Auto Trait Implementations
impl<T> !RefUnwindSafe for ProtoBufMessage<T>
impl<T> !Send for ProtoBufMessage<T>
impl<T> !Sync for ProtoBufMessage<T>
impl<T> Unpin for ProtoBufMessage<T>
impl<T> !UnwindSafe for ProtoBufMessage<T>
Blanket Implementations
Immutably borrows from an owned value. Read more
diff --git a/actix_protobuf/trait.ProtoBufResponseBuilder.html b/actix_protobuf/trait.ProtoBufResponseBuilder.html
index 9d0742f4c..4b3e8e3ad 100644
--- a/actix_protobuf/trait.ProtoBufResponseBuilder.html
+++ b/actix_protobuf/trait.ProtoBufResponseBuilder.html
@@ -1,5 +1,5 @@
-ProtoBufResponseBuilder in actix_protobuf - Rust Trait actix_protobuf::ProtoBufResponseBuilder [−][src]
pub trait ProtoBufResponseBuilder {
+ProtoBufResponseBuilder in actix_protobuf - Rust Trait actix_protobuf::ProtoBufResponseBuilder [−][src]
pub trait ProtoBufResponseBuilder {
fn protobuf<T: Message>(&mut self, value: T) -> Result<HttpResponse, Error>;
-}
Required methods
Implementations on Foreign Types
Implementors
+}
Required methods
Implementations on Foreign Types
Implementors
\ No newline at end of file
diff --git a/actix_session/index.html b/actix_session/index.html
index c8738ca39..076dadf36 100644
--- a/actix_session/index.html
+++ b/actix_session/index.html
@@ -1,4 +1,4 @@
-actix_session - Rust Crate actix_session[−][src]
Expand description
Sessions for Actix Web.
+actix_session - Rust Crate actix_session[−][src]
Expand description
Sessions for Actix Web.
Provides a general solution for session management. Session middleware could provide different
implementations which could be accessed via general session API.
This crate provides a general solution for session management and includes a cookie backend.
diff --git a/actix_session/struct.CookieSession.html b/actix_session/struct.CookieSession.html
index 9305c8f95..6c70f1b03 100644
--- a/actix_session/struct.CookieSession.html
+++ b/actix_session/struct.CookieSession.html
@@ -1,4 +1,4 @@
-
CookieSession in actix_session - Rust Struct actix_session::CookieSession [−][src]
pub struct CookieSession(_);
Expand description
Use cookies for session storage.
+CookieSession in actix_session - Rust Struct actix_session::CookieSession [−][src]
pub struct CookieSession(_);
Expand description
Use cookies for session storage.
CookieSession
creates sessions which are limited to storing
fewer than 4000 bytes of data (as the payload must fit into a single
cookie). An Internal Server Error is generated if the session contains more
@@ -28,31 +28,31 @@ cause troubles when reading cookie, if they are not properly percent encoded.
path("/")
.secure(true))
.service(web::resource("/").to(|| HttpResponse::Ok()));
-Implementations
Implementations
Construct new signed CookieSession
instance.
Panics if key length is less than 32 bytes.
-
Construct new private CookieSession
instance.
Panics if key length is less than 32 bytes.
-
Sets the path
field in the session cookie being built.
-
Sets the name
field in the session cookie being built.
-
Sets the domain
field in the session cookie being built.
-
When true, prevents adding session cookies to responses until
+
Sets the path
field in the session cookie being built.
+
Sets the name
field in the session cookie being built.
+
Sets the domain
field in the session cookie being built.
+
When true, prevents adding session cookies to responses until
the session contains data. Default is false
.
Useful when trying to comply with laws that require consent for setting cookies.
-
Sets the secure
field in the session cookie being built.
+
Sets the secure
field in the session cookie being built.
If the secure
field is set, a cookie will only be transmitted when the
connection is secure - i.e. https
-
Sets the http_only
field in the session cookie being built.
-
Sets the same_site
field in the session cookie being built.
-
Sets the max-age
field in the session cookie being built.
-
Sets the max-age
field in the session cookie being built.
-
Sets the expires
field in the session cookie being built.
-
Sets the expires
field in the session cookie being built.
-Trait Implementations
impl<S, B> Transform<S, ServiceRequest> for CookieSession where
S: Service<ServiceRequest, Response = ServiceResponse<B>>,
S::Future: 'static,
S::Error: 'static,
B: MessageBody + 'static,
B::Error: StdError,
type Response = ServiceResponse
Responses produced by the service.
+
Sets the http_only
field in the session cookie being built.
+
Sets the same_site
field in the session cookie being built.
+
Sets the max-age
field in the session cookie being built.
+
Sets the max-age
field in the session cookie being built.
+
Sets the expires
field in the session cookie being built.
+
Sets the expires
field in the session cookie being built.
+Trait Implementations
impl<S, B> Transform<S, ServiceRequest> for CookieSession where
S: Service<ServiceRequest, Response = ServiceResponse<B>>,
S::Future: 'static,
S::Error: 'static,
B: MessageBody + 'static,
B::Error: StdError,
type Response = ServiceResponse
Responses produced by the service.
type Error = S::Error
Errors produced by the service.
type Transform = CookieSessionMiddleware<S>
The TransformService
value created by this factory
Creates and returns a new Transform component, asynchronously
+
Creates and returns a new Transform component, asynchronously
Auto Trait Implementations
impl !RefUnwindSafe for CookieSession
impl !Send for CookieSession
impl !Sync for CookieSession
impl Unpin for CookieSession
impl UnwindSafe for CookieSession
Blanket Implementations
Mutably borrows from an owned value. Read more
diff --git a/actix_session/struct.Session.html b/actix_session/struct.Session.html
index 98d70d4b1..2fa48de8c 100644
--- a/actix_session/struct.Session.html
+++ b/actix_session/struct.Session.html
@@ -15,21 +15,21 @@ implemented for HttpRequest
, ServiceRequest
, and Ok("Welcome!")
}
-Implementations
Get a value
from the session.
+Implementations
Get a value
from the session.
Get all raw key-value data from the session.
Note that values are JSON encoded.
-
Inserts a key-value pair into the session.
+
Inserts a key-value pair into the session.
Any serializable value can be used and will be encoded as JSON in session data, hence why
only a reference to the value is taken.
-
Remove value from the session.
If present, the JSON encoded value is returned.
-
Remove value from the session and deserialize.
+
Remove value from the session and deserialize.
Returns None if key was not present in session. Returns T if deserialization succeeds,
otherwise returns un-deserialized JSON string.
-pub fn set_session(
req: &mut ServiceRequest,
data: impl IntoIterator<Item = (String, String)>
)
Adds the given key-value pairs to the session on the request.
+pub fn set_session(
req: &mut ServiceRequest,
data: impl IntoIterator<Item = (String, String)>
)
Adds the given key-value pairs to the session on the request.
Values that match keys already existing on the session will be overwritten. Values should
already be JSON serialized.
Examples
@@ -39,8 +39,8 @@ already be JSON serialized.
&mut req,
vec![("counter".to_string(), serde_json::to_string(&0).unwrap())],
);
-pub fn get_changes<B>(
res: &mut ServiceResponse<B>
) -> (SessionStatus, impl Iterator<Item = (String, String)>)
Returns session status and iterator of key-value pairs of changes.
-Trait Implementations
pub fn get_changes<B>(
res: &mut ServiceResponse<B>
) -> (SessionStatus, impl Iterator<Item = (String, String)>)
Returns session status and iterator of key-value pairs of changes.
+Trait Implementations
Extractor implementation for Session type.
Examples
use actix_session::Session;
@@ -59,7 +59,7 @@ already be JSON serialized.
Auto Trait Implementations
impl !RefUnwindSafe for Session
impl !UnwindSafe for Session
Blanket Implementations
Gets the TypeId
of self
. Read more
diff --git a/actix_web_httpauth/extractors/basic/index.html b/actix_web_httpauth/extractors/basic/index.html
index ade100b5a..1c5f96bd0 100644
--- a/actix_web_httpauth/extractors/basic/index.html
+++ b/actix_web_httpauth/extractors/basic/index.html
@@ -1,4 +1,4 @@
-actix_web_httpauth::extractors::basic - Rust Module actix_web_httpauth::extractors::basic [−][src]
Expand description
Extractor for the “Basic” HTTP Authentication Scheme
+actix_web_httpauth::extractors::basic - Rust Module actix_web_httpauth::extractors::basic [−][src]
Expand description
Extractor for the “Basic” HTTP Authentication Scheme
Structs
Extractor for HTTP Basic auth.
BasicAuth
extractor configuration,
diff --git a/actix_web_httpauth/extractors/basic/struct.BasicAuth.html b/actix_web_httpauth/extractors/basic/struct.BasicAuth.html
index 579512cdd..31833e94e 100644
--- a/actix_web_httpauth/extractors/basic/struct.BasicAuth.html
+++ b/actix_web_httpauth/extractors/basic/struct.BasicAuth.html
@@ -24,16 +24,16 @@ response header.
}
Implementations
Trait Implementations
type Error = AuthenticationError<Challenge>
The associated error which can be returned.
+Trait Implementations
type Error = AuthenticationError<Challenge>
The associated error which can be returned.
Future that resolves into extracted credentials type.
-
Parse the authentication credentials from the actix’ ServiceRequest
.
+
Parse the authentication credentials from the actix’ ServiceRequest
.
type Error = AuthenticationError<Challenge>
The associated error which can be returned.
-
Create a Self from request parts asynchronously.
+
Create a Self from request parts asynchronously.
Auto Trait Implementations
impl RefUnwindSafe for BasicAuth
impl UnwindSafe for BasicAuth
Blanket Implementations
Gets the TypeId
of self
. Read more
diff --git a/actix_web_httpauth/extractors/bearer/index.html b/actix_web_httpauth/extractors/bearer/index.html
index a1df61a16..b06b57f73 100644
--- a/actix_web_httpauth/extractors/bearer/index.html
+++ b/actix_web_httpauth/extractors/bearer/index.html
@@ -1,4 +1,4 @@
-actix_web_httpauth::extractors::bearer - Rust Module actix_web_httpauth::extractors::bearer [−][src]
Expand description
Extractor for the “Bearer” HTTP Authentication Scheme
+actix_web_httpauth::extractors::bearer - Rust Module actix_web_httpauth::extractors::bearer [−][src]
Expand description
Extractor for the “Bearer” HTTP Authentication Scheme
Structs
Extractor for HTTP Bearer auth
BearerAuth extractor configuration.
diff --git a/actix_web_httpauth/extractors/bearer/struct.BearerAuth.html b/actix_web_httpauth/extractors/bearer/struct.BearerAuth.html
index a558ebde0..58af63fa1 100644
--- a/actix_web_httpauth/extractors/bearer/struct.BearerAuth.html
+++ b/actix_web_httpauth/extractors/bearer/struct.BearerAuth.html
@@ -26,16 +26,16 @@ response header.
.service(web::resource("/index.html").route(web::get().to(index)));
}
Implementations
Trait Implementations
Trait Implementations
type Error = AuthenticationError<Bearer>
The associated error which can be returned.
-
Parse the authentication credentials from the actix’ ServiceRequest
.
+
Parse the authentication credentials from the actix’ ServiceRequest
.
type Error = AuthenticationError<Bearer>
The associated error which can be returned.
-
Create a Self from request parts asynchronously.
+
Create a Self from request parts asynchronously.
Auto Trait Implementations
impl RefUnwindSafe for BearerAuth
impl Send for BearerAuth
impl Sync for BearerAuth
impl Unpin for BearerAuth
impl UnwindSafe for BearerAuth
Blanket Implementations
Gets the TypeId
of self
. Read more
diff --git a/actix_web_httpauth/extractors/struct.AuthenticationError.html b/actix_web_httpauth/extractors/struct.AuthenticationError.html
index f4c9e9294..4fc393fd6 100644
--- a/actix_web_httpauth/extractors/struct.AuthenticationError.html
+++ b/actix_web_httpauth/extractors/struct.AuthenticationError.html
@@ -1,12 +1,12 @@
AuthenticationError in actix_web_httpauth::extractors - Rust Struct actix_web_httpauth::extractors::AuthenticationError [−][src]
pub struct AuthenticationError<C: Challenge> { /* fields omitted */ }
Expand description
Authentication error returned by authentication extractors.
Different extractors may extend AuthenticationError
implementation
in order to provide access to inner challenge fields.
-Implementations
Extended error customization for HTTP Bearer
auth.
-
Attach Error
to the current Authentication error.
+Implementations
Extended error customization for HTTP Bearer
auth.
+
Attach Error
to the current Authentication error.
Error status code will be changed to the one provided by the kind
Error.
-
Attach error description to the current Authentication error.
-
Attach error URI to the current Authentication error.
+
Attach error description to the current Authentication error.
+
Attach error URI to the current Authentication error.
It is up to implementor to provide properly formed absolute URI.
Creates new authentication error from the provided challenge
.
By default returned error will resolve into the HTTP 401
status code.
diff --git a/actix_web_httpauth/extractors/trait.AuthExtractor.html b/actix_web_httpauth/extractors/trait.AuthExtractor.html
index d1155d0db..7df25ea43 100644
--- a/actix_web_httpauth/extractors/trait.AuthExtractor.html
+++ b/actix_web_httpauth/extractors/trait.AuthExtractor.html
@@ -12,6 +12,6 @@ authentication scheme.
Associated Types
Required methods
fn from_service_request(req: &ServiceRequest) -> Self::Future
Parse the authentication credentials from the actix’ ServiceRequest
.
-Implementors
+Implementors
\ No newline at end of file
diff --git a/actix_web_httpauth/headers/authorization/struct.Authorization.html b/actix_web_httpauth/headers/authorization/struct.Authorization.html
index 82128a26f..a18d7ace2 100644
--- a/actix_web_httpauth/headers/authorization/struct.Authorization.html
+++ b/actix_web_httpauth/headers/authorization/struct.Authorization.html
@@ -1,4 +1,4 @@
-Authorization in actix_web_httpauth::headers::authorization - Rust Struct actix_web_httpauth::headers::authorization::Authorization [−][src]
pub struct Authorization<S: Scheme>(_);
Expand description
Authorization
header, defined in RFC 7235
+Authorization in actix_web_httpauth::headers::authorization - Rust Struct actix_web_httpauth::headers::authorization::Authorization [−][src]
pub struct Authorization<S: Scheme>(_);
Expand description
Authorization
header, defined in RFC 7235
The “Authorization” header field allows a user agent to authenticate
itself with an origin server – usually, but not necessarily, after
receiving a 401 (Unauthorized) response. Its value consists of
@@ -12,37 +12,37 @@ scheme.
Ok(format!("Hello, {}!", auth.as_ref().user_id()))
}
-Implementations
Consumes Authorization
header and returns inner Scheme
+
Implementations
Consumes Authorization
header and returns inner Scheme
implementation.
-Trait Implementations
Returns a copy of the value. Read more
+Trait Implementations
Returns the “default value” for a type. Read more
-
Performs the conversion.
-
Returns the “default value” for a type. Read more
+
Performs the conversion.
+
type Error = <S as IntoHeaderValue>::Error
The type returned in the event of a conversion error.
-
Try to convert value to a HeaderValue.
-
type Error = <S as IntoHeaderValue>::Error
The type returned in the event of a conversion error.
+
Try to convert value to a HeaderValue.
+
This method tests for self
and other
values to be equal, and is used
+
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
-
This method tests for !=
.
-
This method returns an ordering between self
and other
values if one exists. Read more
+
This method tests for !=
.
+
This method returns an ordering between self
and other
values if one exists. Read more
This method tests less than (for self
and other
) and is used by the <
operator. Read more
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
Auto Trait Implementations
impl<S> RefUnwindSafe for Authorization<S> where
S: RefUnwindSafe,
impl<S> Send for Authorization<S>
impl<S> Sync for Authorization<S>
impl<S> Unpin for Authorization<S> where
S: Unpin,
impl<S> UnwindSafe for Authorization<S> where
S: UnwindSafe,
Blanket Implementations
Auto Trait Implementations
impl<S> RefUnwindSafe for Authorization<S> where
S: RefUnwindSafe,
impl<S> Send for Authorization<S>
impl<S> Sync for Authorization<S>
impl<S> Unpin for Authorization<S> where
S: Unpin,
impl<S> UnwindSafe for Authorization<S> where
S: UnwindSafe,
Blanket Implementations
Mutably borrows from an owned value. Read more
Compare self to key
and return true
if they are equal.
diff --git a/actix_web_httpauth/headers/www_authenticate/struct.WwwAuthenticate.html b/actix_web_httpauth/headers/www_authenticate/struct.WwwAuthenticate.html
index 446daa9d1..859d735a1 100644
--- a/actix_web_httpauth/headers/www_authenticate/struct.WwwAuthenticate.html
+++ b/actix_web_httpauth/headers/www_authenticate/struct.WwwAuthenticate.html
@@ -1,32 +1,32 @@
-WwwAuthenticate in actix_web_httpauth::headers::www_authenticate - Rust Struct actix_web_httpauth::headers::www_authenticate::WwwAuthenticate [−][src]
pub struct WwwAuthenticate<C: Challenge>(pub C);
Expand description
WWW-Authenticate
header, described in RFC 7235
+WwwAuthenticate in actix_web_httpauth::headers::www_authenticate - Rust Struct actix_web_httpauth::headers::www_authenticate::WwwAuthenticate [−][src]
pub struct WwwAuthenticate<C: Challenge>(pub C);
Expand description
Tuple Fields
0: C
Trait Implementations
Returns a copy of the value. Read more
+Tuple Fields
0: C
Trait Implementations
Returns the “default value” for a type. Read more
-
Returns the “default value” for a type. Read more
+
type Error = <C as IntoHeaderValue>::Error
The type returned in the event of a conversion error.
-
Try to convert value to a HeaderValue.
-
type Error = <C as IntoHeaderValue>::Error
The type returned in the event of a conversion error.
+
Try to convert value to a HeaderValue.
+
This method tests for self
and other
values to be equal, and is used
+
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
-
This method tests for !=
.
-
This method returns an ordering between self
and other
values if one exists. Read more
+
This method tests for !=
.
+
This method returns an ordering between self
and other
values if one exists. Read more
This method tests less than (for self
and other
) and is used by the <
operator. Read more
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
Auto Trait Implementations
impl<C> RefUnwindSafe for WwwAuthenticate<C> where
C: RefUnwindSafe,
impl<C> Send for WwwAuthenticate<C>
impl<C> Sync for WwwAuthenticate<C>
impl<C> Unpin for WwwAuthenticate<C> where
C: Unpin,
impl<C> UnwindSafe for WwwAuthenticate<C> where
C: UnwindSafe,
Blanket Implementations
Auto Trait Implementations
impl<C> RefUnwindSafe for WwwAuthenticate<C> where
C: RefUnwindSafe,
impl<C> Send for WwwAuthenticate<C>
impl<C> Sync for WwwAuthenticate<C>
impl<C> Unpin for WwwAuthenticate<C> where
C: Unpin,
impl<C> UnwindSafe for WwwAuthenticate<C> where
C: UnwindSafe,
Blanket Implementations
Mutably borrows from an owned value. Read more
Compare self to key
and return true
if they are equal.
diff --git a/actix_web_httpauth/middleware/index.html b/actix_web_httpauth/middleware/index.html
index a7137ea11..ba80ceb94 100644
--- a/actix_web_httpauth/middleware/index.html
+++ b/actix_web_httpauth/middleware/index.html
@@ -1,4 +1,4 @@
-actix_web_httpauth::middleware - Rust Module actix_web_httpauth::middleware [−][src]
Expand description
HTTP Authentication middleware.
+actix_web_httpauth::middleware - Rust Module actix_web_httpauth::middleware [−][src]
Expand description
HTTP Authentication middleware.
Structs
Middleware for checking HTTP authentication.
diff --git a/actix_web_httpauth/middleware/struct.HttpAuthentication.html b/actix_web_httpauth/middleware/struct.HttpAuthentication.html
index 52a2191dc..a8b11a0bd 100644
--- a/actix_web_httpauth/middleware/struct.HttpAuthentication.html
+++ b/actix_web_httpauth/middleware/struct.HttpAuthentication.html
@@ -1,11 +1,11 @@
-HttpAuthentication in actix_web_httpauth::middleware - Rust Struct actix_web_httpauth::middleware::HttpAuthentication [−][src]
pub struct HttpAuthentication<T, F> where
T: AuthExtractor, { /* fields omitted */ }
Expand description
Middleware for checking HTTP authentication.
+HttpAuthentication in actix_web_httpauth::middleware - Rust Struct actix_web_httpauth::middleware::HttpAuthentication [−][src]
pub struct HttpAuthentication<T, F> where
T: AuthExtractor, { /* fields omitted */ }
Expand description
Middleware for checking HTTP authentication.
If there is no Authorization
header in the request, this middleware returns an error
immediately, without calling the F
callback.
Otherwise, it will pass both the request and the parsed credentials into it. In case of
successful validation F
callback is required to return the ServiceRequest
back.
-Implementations
impl<T, F, O> HttpAuthentication<T, F> where
T: AuthExtractor,
F: Fn(ServiceRequest, T) -> O,
O: Future<Output = Result<ServiceRequest, Error>>,
Construct HttpAuthentication
middleware with the provided auth extractor T
and
+
Implementations
impl<T, F, O> HttpAuthentication<T, F> where
T: AuthExtractor,
F: Fn(ServiceRequest, T) -> O,
O: Future<Output = Result<ServiceRequest, Error>>,
Construct HttpAuthentication
middleware with the provided auth extractor T
and
validation callback F
.
-
Construct HttpAuthentication
middleware for the HTTP “Basic” authentication scheme.
Example
// In this example validator returns immediately, but since it is required to return
// anything that implements `IntoFuture` trait, it can be extended to query database or to
@@ -19,7 +19,7 @@ validation callback F
.
}
let middleware = HttpAuthentication::basic(validator);
-impl<F, O> HttpAuthentication<BearerAuth, F> where
F: Fn(ServiceRequest, BearerAuth) -> O,
O: Future<Output = Result<ServiceRequest, Error>>,
impl<F, O> HttpAuthentication<BearerAuth, F> where
F: Fn(ServiceRequest, BearerAuth) -> O,
O: Future<Output = Result<ServiceRequest, Error>>,
Construct HttpAuthentication
middleware for the HTTP “Bearer” authentication scheme.
Example
async fn validator(req: ServiceRequest, credentials: BearerAuth) -> Result<ServiceRequest, Error> {
if credentials.token() == "mF_9.B5f-4.1JqM" {
@@ -35,15 +35,15 @@ validation callback F
.
}
let middleware = HttpAuthentication::bearer(validator);
-Trait Implementations
Returns a copy of the value. Read more
+Trait Implementations
impl<S, B, T, F, O> Transform<S, ServiceRequest> for HttpAuthentication<T, F> where
S: Service<ServiceRequest, Response = ServiceResponse<B>, Error = Error> + 'static,
S::Future: 'static,
F: Fn(ServiceRequest, T) -> O + 'static,
O: Future<Output = Result<ServiceRequest, Error>> + 'static,
T: AuthExtractor + 'static,
B: MessageBody + 'static,
B::Error: StdError,
type Response = ServiceResponse
Responses produced by the service.
+
impl<S, B, T, F, O> Transform<S, ServiceRequest> for HttpAuthentication<T, F> where
S: Service<ServiceRequest, Response = ServiceResponse<B>, Error = Error> + 'static,
S::Future: 'static,
F: Fn(ServiceRequest, T) -> O + 'static,
O: Future<Output = Result<ServiceRequest, Error>> + 'static,
T: AuthExtractor + 'static,
B: MessageBody + 'static,
B::Error: StdError,
type Response = ServiceResponse
Responses produced by the service.
type Error = Error
Errors produced by the service.
type Transform = AuthenticationMiddleware<S, F, T>
The TransformService
value created by this factory
Creates and returns a new Transform component, asynchronously
+
Creates and returns a new Transform component, asynchronously
Auto Trait Implementations
impl<T, F> RefUnwindSafe for HttpAuthentication<T, F> where
F: RefUnwindSafe,
T: RefUnwindSafe,
impl<T, F> Send for HttpAuthentication<T, F> where
F: Send + Sync,
T: Send,
impl<T, F> Sync for HttpAuthentication<T, F> where
F: Send + Sync,
T: Sync,
impl<T, F> Unpin for HttpAuthentication<T, F> where
T: Unpin,
impl<T, F> UnwindSafe for HttpAuthentication<T, F> where
F: RefUnwindSafe,
T: UnwindSafe,
Blanket Implementations
Mutably borrows from an owned value. Read more
diff --git a/src/actix_cors/builder.rs.html b/src/actix_cors/builder.rs.html
index 228ab4655..beed8b217 100644
--- a/src/actix_cors/builder.rs.html
+++ b/src/actix_cors/builder.rs.html
@@ -617,12 +617,6 @@
617
618
619
-620
-621
-622
-623
-624
-625
use std::{collections::HashSet, convert::TryInto, iter::FromIterator, rc::Rc};
use actix_web::{
@@ -775,8 +769,7 @@
Ok(_) => {
if cors.allowed_origins.is_all() {
- cors.allowed_origins =
- AllOrSome::Some(HashSet::with_capacity(8));
+ cors.allowed_origins = AllOrSome::Some(HashSet::with_capacity(8));
}
if let Some(origins) = cors.allowed_origins.as_mut() {
@@ -882,8 +875,7 @@
match header.try_into() {
Ok(method) => {
if cors.allowed_headers.is_all() {
- cors.allowed_headers =
- AllOrSome::Some(HashSet::with_capacity(8));
+ cors.allowed_headers = AllOrSome::Some(HashSet::with_capacity(8));
}
if let AllOrSome::Some(ref mut headers) = cors.allowed_headers {
@@ -919,8 +911,7 @@
match h.try_into() {
Ok(method) => {
if cors.allowed_headers.is_all() {
- cors.allowed_headers =
- AllOrSome::Some(HashSet::with_capacity(8));
+ cors.allowed_headers = AllOrSome::Some(HashSet::with_capacity(8));
}
if let AllOrSome::Some(ref mut headers) = cors.allowed_headers {
@@ -967,8 +958,7 @@
Ok(header) => {
if let Some(cors) = cors(&mut self.inner, &self.error) {
if cors.expose_headers.is_all() {
- cors.expose_headers =
- AllOrSome::Some(HashSet::with_capacity(8));
+ cors.expose_headers = AllOrSome::Some(HashSet::with_capacity(8));
}
if let AllOrSome::Some(ref mut headers) = cors.expose_headers {
headers.insert(header);
@@ -1131,12 +1121,11 @@
let mut inner = Rc::clone(&self.inner);
- if inner.supports_credentials
- && inner.send_wildcard
- && inner.allowed_origins.is_all()
- {
- error!("Illegal combination of CORS options: credentials can not be supported when all \
- origins are allowed and `send_wildcard` is enabled.");
+ if inner.supports_credentials && inner.send_wildcard && inner.allowed_origins.is_all() {
+ error!(
+ "Illegal combination of CORS options: credentials can not be supported when all \
+ origins are allowed and `send_wildcard` is enabled."
+ );
return future::err(());
}
@@ -1144,8 +1133,7 @@
match inner.allowed_headers.as_ref() {
Some(header_set) if !header_set.is_empty() => {
let allowed_headers_str = intersperse_header_values(header_set);
- Rc::make_mut(&mut inner).allowed_headers_baked =
- Some(allowed_headers_str);
+ Rc::make_mut(&mut inner).allowed_headers_baked = Some(allowed_headers_str);
}
_ => {}
}
diff --git a/src/actix_cors/error.rs.html b/src/actix_cors/error.rs.html
index 09867e1f2..21806ced2 100644
--- a/src/actix_cors/error.rs.html
+++ b/src/actix_cors/error.rs.html
@@ -48,12 +48,6 @@
48
49
50
-51
-52
-53
-54
-55
-56
use actix_web::{http::StatusCode, HttpResponse, ResponseError};
use derive_more::{Display, Error};
@@ -71,21 +65,15 @@
MissingOrigin,
/// Request header `Access-Control-Request-Method` is required but is missing.
- #[display(
- fmt = "Request header `Access-Control-Request-Method` is required but is missing."
- )]
+ #[display(fmt = "Request header `Access-Control-Request-Method` is required but is missing.")]
MissingRequestMethod,
/// Request header `Access-Control-Request-Method` has an invalid value.
- #[display(
- fmt = "Request header `Access-Control-Request-Method` has an invalid value."
- )]
+ #[display(fmt = "Request header `Access-Control-Request-Method` has an invalid value.")]
BadRequestMethod,
/// Request header `Access-Control-Request-Headers` has an invalid value.
- #[display(
- fmt = "Request header `Access-Control-Request-Headers` has an invalid value."
- )]
+ #[display(fmt = "Request header `Access-Control-Request-Headers` has an invalid value.")]
BadRequestHeaders,
/// Origin is not allowed to make this request.
diff --git a/src/actix_cors/inner.rs.html b/src/actix_cors/inner.rs.html
index cf4c45a35..b6769278e 100644
--- a/src/actix_cors/inner.rs.html
+++ b/src/actix_cors/inner.rs.html
@@ -325,17 +325,6 @@
325
326
327
-328
-329
-330
-331
-332
-333
-334
-335
-336
-337
-338
use std::{collections::HashSet, convert::TryFrom, convert::TryInto, fmt, rc::Rc};
use actix_web::{
@@ -416,9 +405,7 @@
match req.headers().get(header::ORIGIN) {
// origin header exists and is a string
Some(origin) => {
- if allowed_origins.contains(origin)
- || self.validate_origin_fns(origin, req)
- {
+ if allowed_origins.contains(origin) || self.validate_origin_fns(origin, req) {
Ok(())
} else {
Err(CorsError::OriginNotAllowed)
@@ -440,10 +427,7 @@
}
/// Only called if origin exists and always after it's validated.
- pub(crate) fn access_control_allow_origin(
- &self,
- req: &RequestHead,
- ) -> Option<HeaderValue> {
+ pub(crate) fn access_control_allow_origin(&self, req: &RequestHead) -> Option<HeaderValue> {
let origin = req.headers().get(header::ORIGIN);
match self.allowed_origins {
@@ -467,10 +451,7 @@
/// Use in preflight checks and therefore operates on header list in
/// `Access-Control-Request-Headers` not the actual header set.
- pub(crate) fn validate_allowed_method(
- &self,
- req: &RequestHead,
- ) -> Result<(), CorsError> {
+ pub(crate) fn validate_allowed_method(&self, req: &RequestHead) -> Result<(), CorsError> {
// extract access control header and try to parse as method
let request_method = req
.headers()
@@ -492,10 +473,7 @@
}
}
- pub(crate) fn validate_allowed_headers(
- &self,
- req: &RequestHead,
- ) -> Result<(), CorsError> {
+ pub(crate) fn validate_allowed_headers(&self, req: &RequestHead) -> Result<(), CorsError> {
// return early if all headers are allowed or get ref to allowed origins set
#[allow(clippy::mutable_key_type)]
let allowed_headers = match &self.allowed_headers {
diff --git a/src/actix_cors/middleware.rs.html b/src/actix_cors/middleware.rs.html
index cec78f8fe..6330e1594 100644
--- a/src/actix_cors/middleware.rs.html
+++ b/src/actix_cors/middleware.rs.html
@@ -212,13 +212,6 @@
212
213
214
-215
-216
-217
-218
-219
-220
-221
use std::{convert::TryInto, error::Error as StdError, rc::Rc};
use actix_web::{
@@ -231,9 +224,7 @@
},
HttpResponse,
};
-use futures_util::future::{
- ok, Either, FutureExt as _, LocalBoxFuture, Ready, TryFutureExt as _,
-};
+use futures_util::future::{ok, Either, FutureExt as _, LocalBoxFuture, Ready, TryFutureExt as _};
use log::debug;
use crate::Inner;
@@ -274,9 +265,7 @@
if let Some(ref headers) = inner.allowed_headers_baked {
res.insert_header((header::ACCESS_CONTROL_ALLOW_HEADERS, headers.clone()));
- } else if let Some(headers) =
- req.headers().get(header::ACCESS_CONTROL_REQUEST_HEADERS)
- {
+ } else if let Some(headers) = req.headers().get(header::ACCESS_CONTROL_REQUEST_HEADERS) {
// all headers allowed, return
res.insert_header((header::ACCESS_CONTROL_ALLOW_HEADERS, headers.clone()));
}
@@ -296,10 +285,7 @@
req.into_response(res)
}
- fn augment_response<B>(
- inner: &Inner,
- mut res: ServiceResponse<B>,
- ) -> ServiceResponse<B> {
+ fn augment_response<B>(inner: &Inner, mut res: ServiceResponse<B>) -> ServiceResponse<B> {
if let Some(origin) = inner.access_control_allow_origin(res.request().head()) {
res.headers_mut()
.insert(header::ACCESS_CONTROL_ALLOW_ORIGIN, origin);
diff --git a/src/actix_identity/cookie.rs.html b/src/actix_identity/cookie.rs.html
index 030598c7e..010fba3ad 100644
--- a/src/actix_identity/cookie.rs.html
+++ b/src/actix_identity/cookie.rs.html
@@ -820,14 +820,6 @@
820
821
822
-823
-824
-825
-826
-827
-828
-829
-830
use std::{rc::Rc, time::SystemTime};
use futures_util::future::{ready, Ready};
@@ -1269,8 +1261,7 @@
match login_timestamp {
LoginTimestampCheck::NoTimestamp => assert_eq!(cv.login_timestamp, None),
LoginTimestampCheck::NewTimestamp => assert!(
- t30sec_ago <= cv.login_timestamp.unwrap()
- && cv.login_timestamp.unwrap() <= now
+ t30sec_ago <= cv.login_timestamp.unwrap() && cv.login_timestamp.unwrap() <= now
),
LoginTimestampCheck::OldTimestamp(old_timestamp) => {
assert_eq!(cv.login_timestamp, Some(old_timestamp))
@@ -1280,8 +1271,7 @@
match visit_timestamp {
VisitTimeStampCheck::NoTimestamp => assert_eq!(cv.visit_timestamp, None),
VisitTimeStampCheck::NewTimestamp => assert!(
- t30sec_ago <= cv.visit_timestamp.unwrap()
- && cv.visit_timestamp.unwrap() <= now
+ t30sec_ago <= cv.visit_timestamp.unwrap() && cv.visit_timestamp.unwrap() <= now
),
}
}
@@ -1318,12 +1308,10 @@
})),
)
.await;
- let resp =
- test::call_service(&srv, TestRequest::with_uri("/index").to_request()).await;
+ let resp = test::call_service(&srv, TestRequest::with_uri("/index").to_request()).await;
assert_eq!(resp.status(), StatusCode::OK);
- let resp =
- test::call_service(&srv, TestRequest::with_uri("/login").to_request()).await;
+ let resp = test::call_service(&srv, TestRequest::with_uri("/login").to_request()).await;
assert_eq!(resp.status(), StatusCode::OK);
let c = resp.response().cookies().next().unwrap().to_owned();
@@ -1368,8 +1356,7 @@
)
.await;
- let resp =
- test::call_service(&srv, TestRequest::with_uri("/login").to_request()).await;
+ let resp = test::call_service(&srv, TestRequest::with_uri("/login").to_request()).await;
assert_eq!(resp.status(), StatusCode::OK);
assert!(resp.headers().contains_key(header::SET_COOKIE));
let c = resp.response().cookies().next().unwrap().to_owned();
@@ -1395,8 +1382,7 @@
)
.await;
- let resp =
- test::call_service(&srv, TestRequest::with_uri("/login").to_request()).await;
+ let resp = test::call_service(&srv, TestRequest::with_uri("/login").to_request()).await;
assert_eq!(resp.status(), StatusCode::OK);
assert!(resp.headers().contains_key(header::SET_COOKIE));
@@ -1458,8 +1444,7 @@
})),
)
.await;
- let resp =
- test::call_service(&srv, TestRequest::with_uri("/login").to_request()).await;
+ let resp = test::call_service(&srv, TestRequest::with_uri("/login").to_request()).await;
assert_eq!(resp.status(), StatusCode::OK);
assert!(resp.headers().contains_key(header::SET_COOKIE));
let c = resp.response().cookies().next().unwrap().to_owned();
@@ -1469,8 +1454,7 @@
#[actix_rt::test]
async fn test_identity_legacy_cookie_is_set() {
let srv = create_identity_server(|c| c).await;
- let mut resp =
- test::call_service(&srv, TestRequest::with_uri("/").to_request()).await;
+ let mut resp = test::call_service(&srv, TestRequest::with_uri("/").to_request()).await;
assert_legacy_login_cookie(&mut resp, COOKIE_LOGIN);
assert_logged_in(resp, None).await;
}
diff --git a/src/actix_identity/middleware.rs.html b/src/actix_identity/middleware.rs.html
index 28efa93d8..336901853 100644
--- a/src/actix_identity/middleware.rs.html
+++ b/src/actix_identity/middleware.rs.html
@@ -170,10 +170,6 @@
170
171
172
-173
-174
-175
-176
use std::{error::Error as StdError, rc::Rc};
use actix_web::{
@@ -181,9 +177,7 @@
dev::{Service, ServiceRequest, ServiceResponse, Transform},
Error, HttpMessage, Result,
};
-use futures_util::future::{
- ready, FutureExt as _, LocalBoxFuture, Ready, TryFutureExt as _,
-};
+use futures_util::future::{ready, FutureExt as _, LocalBoxFuture, Ready, TryFutureExt as _};
use crate::{identity::IdentityItem, IdentityPolicy};
@@ -281,9 +275,7 @@
if let Some(id) = id {
match backend.to_response(id.id, id.changed, &mut res).await {
- Ok(_) => {
- Ok(res.map_body(|_, body| AnyBody::from_message(body)))
- }
+ Ok(_) => Ok(res.map_body(|_, body| AnyBody::from_message(body))),
Err(e) => Ok(res.error_response(e)),
}
} else {
diff --git a/src/actix_protobuf/lib.rs.html b/src/actix_protobuf/lib.rs.html
index 7d19f946c..7c949469c 100644
--- a/src/actix_protobuf/lib.rs.html
+++ b/src/actix_protobuf/lib.rs.html
@@ -325,13 +325,6 @@
325
326
327
-328
-329
-330
-331
-332
-333
-334
#![forbid(unsafe_code)]
#![deny(rust_2018_idioms, nonstandard_style)]
@@ -348,17 +341,15 @@
error::PayloadError,
http::header::{CONTENT_LENGTH, CONTENT_TYPE},
web::BytesMut,
- Error, FromRequest, HttpMessage, HttpRequest, HttpResponse, HttpResponseBuilder,
- Responder, ResponseError,
+ Error, FromRequest, HttpMessage, HttpRequest, HttpResponse, HttpResponseBuilder, Responder,
+ ResponseError,
};
use derive_more::Display;
use futures_util::{
future::{FutureExt as _, LocalBoxFuture},
stream::StreamExt as _,
};
-use prost::{
- DecodeError as ProtoBufDecodeError, EncodeError as ProtoBufEncodeError, Message,
-};
+use prost::{DecodeError as ProtoBufDecodeError, EncodeError as ProtoBufEncodeError, Message};
#[derive(Debug, Display)]
pub enum ProtoBufPayloadError {
@@ -487,9 +478,7 @@
Ok(()) => HttpResponse::Ok()
.content_type("application/protobuf")
.body(buf),
- Err(err) => HttpResponse::from_error(Error::from(
- ProtoBufPayloadError::Serialize(err),
- )),
+ Err(err) => HttpResponse::from_error(Error::from(ProtoBufPayloadError::Serialize(err))),
}
}
}
@@ -543,10 +532,7 @@
impl<T: Message + Default + 'static> Future for ProtoBufMessage<T> {
type Output = Result<T, ProtoBufPayloadError>;
- fn poll(
- mut self: Pin<&mut Self>,
- task: &mut task::Context<'_>,
- ) -> Poll<Self::Output> {
+ fn poll(mut self: Pin<&mut Self>, task: &mut task::Context<'_>) -> Poll<Self::Output> {
if let Some(ref mut fut) = self.fut {
return Pin::new(fut).poll(task);
}
diff --git a/src/actix_redis/session.rs.html b/src/actix_redis/session.rs.html
index 2aa6a916b..aeca83dfd 100644
--- a/src/actix_redis/session.rs.html
+++ b/src/actix_redis/session.rs.html
@@ -704,14 +704,6 @@
704
705
706
-707
-708
-709
-710
-711
-712
-713
-714
use std::{collections::HashMap, iter, rc::Rc};
use actix::prelude::*;
@@ -947,9 +939,7 @@
return Ok(None);
};
- if let Some(cookie) =
- cookies.iter().find(|&cookie| cookie.name() == self.name)
- {
+ if let Some(cookie) = cookies.iter().find(|&cookie| cookie.name() == self.name) {
let mut jar = CookieJar::new();
jar.add_original(cookie.clone());
@@ -1085,8 +1075,8 @@
cookie.set_max_age(Duration::zero());
cookie.set_expires(OffsetDateTime::now_utc() - Duration::days(365));
- let val = HeaderValue::from_str(&cookie.to_string())
- .map_err(error::ErrorInternalServerError)?;
+ let val =
+ HeaderValue::from_str(&cookie.to_string()).map_err(error::ErrorInternalServerError)?;
res.headers_mut().append(header::SET_COOKIE, val);
Ok(())
@@ -1137,10 +1127,7 @@
user_id: String,
}
- async fn login(
- user_id: web::Json<Identity>,
- session: Session,
- ) -> Result<HttpResponse> {
+ async fn login(user_id: web::Json<Identity>, session: Session) -> Result<HttpResponse> {
let id = user_id.into_inner().user_id;
session.insert("user_id", &id)?;
session.renew();
@@ -1204,10 +1191,7 @@
let srv = actix_test::start(|| {
App::new()
- .wrap(
- RedisSession::new("127.0.0.1:6379", &[0; 32])
- .cookie_name("test-session"),
- )
+ .wrap(RedisSession::new("127.0.0.1:6379", &[0; 32]).cookie_name("test-session"))
.wrap(middleware::Logger::default())
.service(resource("/").route(get().to(index)))
.service(resource("/do_something").route(post().to(do_something)))
diff --git a/src/actix_session/cookie.rs.html b/src/actix_session/cookie.rs.html
index 247f38863..932aea8cc 100644
--- a/src/actix_session/cookie.rs.html
+++ b/src/actix_session/cookie.rs.html
@@ -558,12 +558,6 @@
558
559
560
-561
-562
-563
-564
-565
-566
//! Cookie based sessions. See docs for [`CookieSession`].
use std::{collections::HashMap, error::Error as StdError, rc::Rc};
@@ -643,8 +637,7 @@
return Ok(());
}
- let value =
- serde_json::to_string(&state).map_err(CookieSessionError::Serialize)?;
+ let value = serde_json::to_string(&state).map_err(CookieSessionError::Serialize)?;
if value.len() > 4064 {
return Err(CookieSessionError::Overflow.into());
@@ -709,9 +702,7 @@
let cookie_opt = match self.security {
CookieSecurity::Signed => jar.signed(&self.key).get(&self.name),
- CookieSecurity::Private => {
- jar.private(&self.key).get(&self.name)
- }
+ CookieSecurity::Private => jar.private(&self.key).get(&self.name),
};
if let Some(cookie) = cookie_opt {
@@ -1094,10 +1085,7 @@
let _ = ses.insert("counter", 100);
"test"
}))
- .service(
- web::resource("/test/")
- .to(|| async move { "no-changes-in-session" }),
- ),
+ .service(web::resource("/test/").to(|| async move { "no-changes-in-session" })),
)
.await;
diff --git a/src/actix_session/lib.rs.html b/src/actix_session/lib.rs.html
index bd7a476d9..0971c0528 100644
--- a/src/actix_session/lib.rs.html
+++ b/src/actix_session/lib.rs.html
@@ -399,16 +399,6 @@
399
400
401
-402
-403
-404
-405
-406
-407
-408
-409
-410
-411
//! Sessions for Actix Web.
//!
//! Provides a general solution for session management. Session middleware could provide different
@@ -576,11 +566,7 @@
///
/// Any serializable value can be used and will be encoded as JSON in session data, hence why
/// only a reference to the value is taken.
- pub fn insert(
- &self,
- key: impl Into<String>,
- value: impl Serialize,
- ) -> Result<(), Error> {
+ pub fn insert(&self, key: impl Into<String>, value: impl Serialize) -> Result<(), Error> {
let mut inner = self.0.borrow_mut();
if inner.status != SessionStatus::Purged {
@@ -610,10 +596,7 @@
///
/// Returns None if key was not present in session. Returns T if deserialization succeeds,
/// otherwise returns un-deserialized JSON string.
- pub fn remove_as<T: DeserializeOwned>(
- &self,
- key: &str,
- ) -> Option<Result<T, String>> {
+ pub fn remove_as<T: DeserializeOwned>(&self, key: &str) -> Option<Result<T, String>> {
self.remove(key)
.map(|val_str| match serde_json::from_str(&val_str) {
Ok(val) => Ok(val),
@@ -670,10 +653,7 @@
/// vec![("counter".to_string(), serde_json::to_string(&0).unwrap())],
/// );
/// ```
- pub fn set_session(
- req: &mut ServiceRequest,
- data: impl IntoIterator<Item = (String, String)>,
- ) {
+ pub fn set_session(req: &mut ServiceRequest, data: impl IntoIterator<Item = (String, String)>) {
let session = Session::get_session(&mut *req.extensions_mut());
let mut inner = session.0.borrow_mut();
inner.state.extend(data);
diff --git a/src/actix_web_httpauth/extractors/basic.rs.html b/src/actix_web_httpauth/extractors/basic.rs.html
index de8d72e20..e92c4a69c 100644
--- a/src/actix_web_httpauth/extractors/basic.rs.html
+++ b/src/actix_web_httpauth/extractors/basic.rs.html
@@ -147,9 +147,6 @@
147
148
149
-150
-151
-152
//! Extractor for the "Basic" HTTP Authentication Scheme
use std::borrow::Cow;
@@ -260,10 +257,7 @@
type Config = Config;
type Error = AuthenticationError<Challenge>;
- fn from_request(
- req: &HttpRequest,
- _: &mut Payload,
- ) -> <Self as FromRequest>::Future {
+ fn from_request(req: &HttpRequest, _: &mut Payload) -> <Self as FromRequest>::Future {
ready(
Authorization::<Basic>::parse(req)
.map(|auth| BasicAuth(auth.into_scheme()))
diff --git a/src/actix_web_httpauth/extractors/bearer.rs.html b/src/actix_web_httpauth/extractors/bearer.rs.html
index 7f6744a3a..9515f6a33 100644
--- a/src/actix_web_httpauth/extractors/bearer.rs.html
+++ b/src/actix_web_httpauth/extractors/bearer.rs.html
@@ -175,9 +175,6 @@
175
176
177
-178
-179
-180
//! Extractor for the "Bearer" HTTP Authentication Scheme
use std::borrow::Cow;
@@ -287,10 +284,7 @@
type Future = Ready<Result<Self, Self::Error>>;
type Error = AuthenticationError<bearer::Bearer>;
- fn from_request(
- req: &HttpRequest,
- _payload: &mut Payload,
- ) -> <Self as FromRequest>::Future {
+ fn from_request(req: &HttpRequest, _payload: &mut Payload) -> <Self as FromRequest>::Future {
ready(
authorization::Authorization::<authorization::Bearer>::parse(req)
.map(|auth| BearerAuth(auth.into_scheme()))
diff --git a/src/actix_web_httpauth/headers/authorization/header.rs.html b/src/actix_web_httpauth/headers/authorization/header.rs.html
index a89cd8ce4..001588570 100644
--- a/src/actix_web_httpauth/headers/authorization/header.rs.html
+++ b/src/actix_web_httpauth/headers/authorization/header.rs.html
@@ -99,14 +99,10 @@
99
100
101
-102
-103
use std::fmt;
use actix_web::error::ParseError;
-use actix_web::http::header::{
- Header, HeaderName, HeaderValue, IntoHeaderValue, AUTHORIZATION,
-};
+use actix_web::http::header::{Header, HeaderName, HeaderValue, IntoHeaderValue, AUTHORIZATION};
use actix_web::HttpMessage;
use crate::headers::authorization::scheme::Scheme;
diff --git a/src/actix_web_httpauth/headers/www_authenticate/header.rs.html b/src/actix_web_httpauth/headers/www_authenticate/header.rs.html
index a753dd6d9..b33b5461f 100644
--- a/src/actix_web_httpauth/headers/www_authenticate/header.rs.html
+++ b/src/actix_web_httpauth/headers/www_authenticate/header.rs.html
@@ -29,12 +29,8 @@
29
30
31
-32
-33
use actix_web::error::ParseError;
-use actix_web::http::header::{
- Header, HeaderName, HeaderValue, IntoHeaderValue, WWW_AUTHENTICATE,
-};
+use actix_web::http::header::{Header, HeaderName, HeaderValue, IntoHeaderValue, WWW_AUTHENTICATE};
use actix_web::HttpMessage;
use super::Challenge;
diff --git a/src/actix_web_httpauth/middleware.rs.html b/src/actix_web_httpauth/middleware.rs.html
index 377292200..e4d478d57 100644
--- a/src/actix_web_httpauth/middleware.rs.html
+++ b/src/actix_web_httpauth/middleware.rs.html
@@ -310,12 +310,10 @@
310
311
312
-313
//! HTTP Authentication middleware.
use std::{
- error::Error as StdError, future::Future, marker::PhantomData, pin::Pin, rc::Rc,
- sync::Arc,
+ error::Error as StdError, future::Future, marker::PhantomData, pin::Pin, rc::Rc, sync::Arc,
};
use actix_web::{