diff --git a/actix_identity/error/enum.GetIdentityError.html b/actix_identity/error/enum.GetIdentityError.html index 6d9944af5..54ba204cd 100644 --- a/actix_identity/error/enum.GetIdentityError.html +++ b/actix_identity/error/enum.GetIdentityError.html @@ -1,15 +1,15 @@ GetIdentityError in actix_identity::error - Rust

Enum actix_identity::error::GetIdentityError

source ·
#[non_exhaustive]
pub enum GetIdentityError { SessionExpiryError(SessionExpiryError), MissingIdentityError(MissingIdentityError), - SessionGetError(SessionGetError), + SessionGetError(SessionGetError), LostIdentityError(LostIdentityError), }
Expand description

Errors that can occur while retrieving an identity.

Variants (Non-exhaustive)§

This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

SessionExpiryError(SessionExpiryError)

The session has expired.

§

MissingIdentityError(MissingIdentityError)

No identity is found in a session.

-
§

SessionGetError(SessionGetError)

Failed to accessing the session store.

+
§

SessionGetError(SessionGetError)

Failed to accessing the session store.

§

LostIdentityError(LostIdentityError)

Identity info was lost after being validated.

Seeing this error indicates a bug in actix-identity.

-

Trait Implementations§

source§

impl Debug for GetIdentityError

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Display for GetIdentityError

source§

fn fmt(&self, _derive_more_display_formatter: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Error for GetIdentityError

source§

fn source(&self) -> Option<&(dyn Error + 'static)>

The lower-level source of this error, if any. Read more
1.0.0 · source§

fn description(&self) -> &str

👎Deprecated since 1.42.0: use the Display impl or to_string()
1.0.0 · source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type based access to context intended for error reports. Read more
source§

impl From<LostIdentityError> for GetIdentityError

source§

fn from(original: LostIdentityError) -> GetIdentityError

Converts to this type from the input type.
source§

impl From<MissingIdentityError> for GetIdentityError

source§

fn from(original: MissingIdentityError) -> GetIdentityError

Converts to this type from the input type.
source§

impl From<SessionExpiryError> for GetIdentityError

source§

fn from(original: SessionExpiryError) -> GetIdentityError

Converts to this type from the input type.
source§

impl From<SessionGetError> for GetIdentityError

source§

fn from(original: SessionGetError) -> GetIdentityError

Converts to this type from the input type.
source§

impl ResponseError for GetIdentityError

source§

fn status_code(&self) -> StatusCode

Returns appropriate status code for error. Read more
§

fn error_response(&self) -> HttpResponse

Creates full response for error. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where +

Trait Implementations§

source§

impl Debug for GetIdentityError

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Display for GetIdentityError

source§

fn fmt(&self, _derive_more_display_formatter: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Error for GetIdentityError

source§

fn source(&self) -> Option<&(dyn Error + 'static)>

The lower-level source of this error, if any. Read more
1.0.0 · source§

fn description(&self) -> &str

👎Deprecated since 1.42.0: use the Display impl or to_string()
1.0.0 · source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type based access to context intended for error reports. Read more
source§

impl From<LostIdentityError> for GetIdentityError

source§

fn from(original: LostIdentityError) -> GetIdentityError

Converts to this type from the input type.
source§

impl From<MissingIdentityError> for GetIdentityError

source§

fn from(original: MissingIdentityError) -> GetIdentityError

Converts to this type from the input type.
source§

impl From<SessionExpiryError> for GetIdentityError

source§

fn from(original: SessionExpiryError) -> GetIdentityError

Converts to this type from the input type.
source§

impl From<SessionGetError> for GetIdentityError

source§

fn from(original: SessionGetError) -> GetIdentityError

Converts to this type from the input type.
source§

impl ResponseError for GetIdentityError

source§

fn status_code(&self) -> StatusCode

Returns appropriate status code for error. Read more
§

fn error_response(&self) -> HttpResponse

Creates full response for error. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

diff --git a/actix_identity/error/struct.LoginError.html b/actix_identity/error/struct.LoginError.html index 0489c1336..6fc7c0db0 100644 --- a/actix_identity/error/struct.LoginError.html +++ b/actix_identity/error/struct.LoginError.html @@ -1,5 +1,5 @@ LoginError in actix_identity::error - Rust

Struct actix_identity::error::LoginError

source ·
pub struct LoginError(/* private fields */);
Expand description

Error that can occur during login attempts.

-

Trait Implementations§

source§

impl Debug for LoginError

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Display for LoginError

source§

fn fmt(&self, _derive_more_display_formatter: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Error for LoginError

source§

fn source(&self) -> Option<&(dyn Error + 'static)>

The lower-level source of this error, if any. Read more
1.0.0 · source§

fn description(&self) -> &str

👎Deprecated since 1.42.0: use the Display impl or to_string()
1.0.0 · source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type based access to context intended for error reports. Read more
source§

impl From<SessionInsertError> for LoginError

source§

fn from(original: SessionInsertError) -> LoginError

Converts to this type from the input type.
source§

impl ResponseError for LoginError

source§

fn status_code(&self) -> StatusCode

Returns appropriate status code for error. Read more
§

fn error_response(&self) -> HttpResponse

Creates full response for error. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where +

Trait Implementations§

source§

impl Debug for LoginError

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Display for LoginError

source§

fn fmt(&self, _derive_more_display_formatter: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Error for LoginError

source§

fn source(&self) -> Option<&(dyn Error + 'static)>

The lower-level source of this error, if any. Read more
1.0.0 · source§

fn description(&self) -> &str

👎Deprecated since 1.42.0: use the Display impl or to_string()
1.0.0 · source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type based access to context intended for error reports. Read more
source§

impl From<SessionInsertError> for LoginError

source§

fn from(original: SessionInsertError) -> LoginError

Converts to this type from the input type.
source§

impl ResponseError for LoginError

source§

fn status_code(&self) -> StatusCode

Returns appropriate status code for error. Read more
§

fn error_response(&self) -> HttpResponse

Creates full response for error. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

diff --git a/actix_session/index.html b/actix_session/index.html index a504e6c1a..b9f9f9138 100644 --- a/actix_session/index.html +++ b/actix_session/index.html @@ -1,4 +1,4 @@ -actix_session - Rust

Crate actix_session

source ·
Expand description

Session management for Actix Web.

+actix_session - Rust

Crate actix_session

source ·
Expand description

Session management for Actix Web.

The HTTP protocol, at a first glance, is stateless: the client sends a request, the server parses its content, performs some processing and returns a response. The outcome is only influenced by the provided inputs (i.e. the request content) and whatever state the server @@ -97,13 +97,13 @@ the redis-session feature flag.

# ... actix-session = { version = "...", features = ["redis-session"] }
-

Add the redis-session-native-tls feature flag if you want to connect to Redis using a secured +

Add the redis-session-native-tls feature flag if you want to connect to Redis using a secure connection (via the native-tls crate):

[dependencies]
 # ...
 actix-session = { version = "...", features = ["redis-session-native-tls"] }
 
-

If you instead prefer depending on rustls, use the redis-session-rustls feature flag:

+

If you, instead, prefer depending on rustls, use the redis-session-rustls feature flag:

[dependencies]
 # ...
 actix-session = { version = "...", features = ["redis-session-rustls"] }
diff --git a/help.html b/help.html
index 69a475496..dceac9fd7 100644
--- a/help.html
+++ b/help.html
@@ -1 +1 @@
-Help

Rustdoc help

Back
\ No newline at end of file +Help

Rustdoc help

Back
\ No newline at end of file diff --git a/settings.html b/settings.html index 2eb6b7128..73bae27d7 100644 --- a/settings.html +++ b/settings.html @@ -1 +1 @@ -Settings

Rustdoc settings

Back
\ No newline at end of file +Settings

Rustdoc settings

Back
\ No newline at end of file diff --git a/src/actix_session/lib.rs.html b/src/actix_session/lib.rs.html index 1008cb3be..d417798fc 100644 --- a/src/actix_session/lib.rs.html +++ b/src/actix_session/lib.rs.html @@ -736,149 +736,145 @@ 736 737 738 -739 -740 -
/*!
-Session management for Actix Web.
-
-The HTTP protocol, at a first glance, is stateless: the client sends a request, the server
-parses its content, performs some processing and returns a response. The outcome is only
-influenced by the provided inputs (i.e. the request content) and whatever state the server
-queries while performing its processing.
-
-Stateless systems are easier to reason about, but they are not quite as powerful as we need them
-to be - e.g. how do you authenticate a user? The user would be forced to authenticate **for
-every single request**. That is, for example, how 'Basic' Authentication works. While it may
-work for a machine user (i.e. an API client), it is impractical for a person—you do not want a
-login prompt on every single page you navigate to!
-
-There is a solution - **sessions**. Using sessions the server can attach state to a set of
-requests coming from the same client. They are built on top of cookies - the server sets a
-cookie in the HTTP response (`Set-Cookie` header), the client (e.g. the browser) will store the
-cookie and play it back to the server when sending new requests (using the `Cookie` header).
-
-We refer to the cookie used for sessions as a **session cookie**. Its content is called
-**session key** (or **session ID**), while the state attached to the session is referred to as
-**session state**.
-
-`actix-session` provides an easy-to-use framework to manage sessions in applications built on
-top of Actix Web. [`SessionMiddleware`] is the middleware underpinning the functionality
-provided by `actix-session`; it takes care of all the session cookie handling and instructs the
-**storage backend** to create/delete/update the session state based on the operations performed
-against the active [`Session`].
-
-`actix-session` provides some built-in storage backends: ([`CookieSessionStore`],
-[`RedisSessionStore`], and [`RedisActorSessionStore`]) - you can create a custom storage backend
-by implementing the [`SessionStore`] trait.
-
-Further reading on sessions:
-- [RFC 6265](https://datatracker.ietf.org/doc/html/rfc6265);
-- [OWASP's session management cheat-sheet](https://cheatsheetseries.owasp.org/cheatsheets/Session_Management_Cheat_Sheet.html).
-
-# Getting started
-To start using sessions in your Actix Web application you must register [`SessionMiddleware`]
-as a middleware on your `App`:
-
-```no_run
-use actix_web::{web, App, HttpServer, HttpResponse, Error};
-use actix_session::{Session, SessionMiddleware, storage::RedisSessionStore};
-use actix_web::cookie::Key;
-
-#[actix_web::main]
-async fn main() -> std::io::Result<()> {
-    // When using `Key::generate()` it is important to initialize outside of the
-    // `HttpServer::new` closure. When deployed the secret key should be read from a
-    // configuration file or environment variables.
-    let secret_key = Key::generate();
-
-    let redis_store = RedisSessionStore::new("redis://127.0.0.1:6379")
-        .await
-        .unwrap();
-
-    HttpServer::new(move ||
-            App::new()
-            // Add session management to your application using Redis for session state storage
-            .wrap(
-                SessionMiddleware::new(
-                    redis_store.clone(),
-                    secret_key.clone(),
-                )
-            )
-            .default_service(web::to(|| HttpResponse::Ok())))
-        .bind(("127.0.0.1", 8080))?
-        .run()
-        .await
-}
-```
-
-The session state can be accessed and modified by your request handlers using the [`Session`]
-extractor. Note that this doesn't work in the stream of a streaming response.
-
-```no_run
-use actix_web::Error;
-use actix_session::Session;
-
-fn index(session: Session) -> Result<&'static str, Error> {
-    // access the session state
-    if let Some(count) = session.get::<i32>("counter")? {
-        println!("SESSION value: {}", count);
-        // modify the session state
-        session.insert("counter", count + 1)?;
-    } else {
-        session.insert("counter", 1)?;
-    }
-
-    Ok("Welcome!")
-}
-```
-
-# Choosing A Backend
-
-By default, `actix-session` does not provide any storage backend to retrieve and save the state
-attached to your sessions. You can enable:
-
-- a purely cookie-based "backend", [`CookieSessionStore`], using the `cookie-session` feature
-  flag.
-
-  ```toml
-  [dependencies]
-  # ...
-  actix-session = { version = "...", features = ["cookie-session"] }
-  ```
-
-- a Redis-based backend via [`redis-rs`](https://docs.rs/redis-rs), [`RedisSessionStore`], using
-  the `redis-session` feature flag.
-
-  ```toml
-  [dependencies]
-  # ...
-  actix-session = { version = "...", features = ["redis-session"] }
-  ```
-
-  Add the `redis-session-native-tls` feature flag if you want to connect to Redis using a secured
-  connection (via the `native-tls` crate):
-
-  ```toml
-  [dependencies]
-  # ...
-  actix-session = { version = "...", features = ["redis-session-native-tls"] }
-  ```
-
-  If you instead prefer depending on `rustls`, use the `redis-session-rustls` feature flag:
-
-  ```toml
-  [dependencies]
-  # ...
-  actix-session = { version = "...", features = ["redis-session-rustls"] }
-  ```
-
-You can implement your own session storage backend using the [`SessionStore`] trait.
-
-[`SessionStore`]: storage::SessionStore
-[`CookieSessionStore`]: storage::CookieSessionStore
-[`RedisSessionStore`]: storage::RedisSessionStore
-[`RedisActorSessionStore`]: storage::RedisActorSessionStore
-*/
+
//! Session management for Actix Web.
+//!
+//! The HTTP protocol, at a first glance, is stateless: the client sends a request, the server
+//! parses its content, performs some processing and returns a response. The outcome is only
+//! influenced by the provided inputs (i.e. the request content) and whatever state the server
+//! queries while performing its processing.
+//!
+//! Stateless systems are easier to reason about, but they are not quite as powerful as we need them
+//! to be - e.g. how do you authenticate a user? The user would be forced to authenticate **for
+//! every single request**. That is, for example, how 'Basic' Authentication works. While it may
+//! work for a machine user (i.e. an API client), it is impractical for a person—you do not want a
+//! login prompt on every single page you navigate to!
+//!
+//! There is a solution - **sessions**. Using sessions the server can attach state to a set of
+//! requests coming from the same client. They are built on top of cookies - the server sets a
+//! cookie in the HTTP response (`Set-Cookie` header), the client (e.g. the browser) will store the
+//! cookie and play it back to the server when sending new requests (using the `Cookie` header).
+//!
+//! We refer to the cookie used for sessions as a **session cookie**. Its content is called
+//! **session key** (or **session ID**), while the state attached to the session is referred to as
+//! **session state**.
+//!
+//! `actix-session` provides an easy-to-use framework to manage sessions in applications built on
+//! top of Actix Web. [`SessionMiddleware`] is the middleware underpinning the functionality
+//! provided by `actix-session`; it takes care of all the session cookie handling and instructs the
+//! **storage backend** to create/delete/update the session state based on the operations performed
+//! against the active [`Session`].
+//!
+//! `actix-session` provides some built-in storage backends: ([`CookieSessionStore`],
+//! [`RedisSessionStore`], and [`RedisActorSessionStore`]) - you can create a custom storage backend
+//! by implementing the [`SessionStore`] trait.
+//!
+//! Further reading on sessions:
+//! - [RFC 6265](https://datatracker.ietf.org/doc/html/rfc6265);
+//! - [OWASP's session management cheat-sheet](https://cheatsheetseries.owasp.org/cheatsheets/Session_Management_Cheat_Sheet.html).
+//!
+//! # Getting started
+//! To start using sessions in your Actix Web application you must register [`SessionMiddleware`]
+//! as a middleware on your `App`:
+//!
+//! ```no_run
+//! use actix_web::{web, App, HttpServer, HttpResponse, Error};
+//! use actix_session::{Session, SessionMiddleware, storage::RedisSessionStore};
+//! use actix_web::cookie::Key;
+//!
+//! #[actix_web::main]
+//! async fn main() -> std::io::Result<()> {
+//!     // When using `Key::generate()` it is important to initialize outside of the
+//!     // `HttpServer::new` closure. When deployed the secret key should be read from a
+//!     // configuration file or environment variables.
+//!     let secret_key = Key::generate();
+//!
+//!     let redis_store = RedisSessionStore::new("redis://127.0.0.1:6379")
+//!         .await
+//!         .unwrap();
+//!
+//!     HttpServer::new(move ||
+//!             App::new()
+//!             // Add session management to your application using Redis for session state storage
+//!             .wrap(
+//!                 SessionMiddleware::new(
+//!                     redis_store.clone(),
+//!                     secret_key.clone(),
+//!                 )
+//!             )
+//!             .default_service(web::to(|| HttpResponse::Ok())))
+//!         .bind(("127.0.0.1", 8080))?
+//!         .run()
+//!         .await
+//! }
+//! ```
+//!
+//! The session state can be accessed and modified by your request handlers using the [`Session`]
+//! extractor. Note that this doesn't work in the stream of a streaming response.
+//!
+//! ```no_run
+//! use actix_web::Error;
+//! use actix_session::Session;
+//!
+//! fn index(session: Session) -> Result<&'static str, Error> {
+//!     // access the session state
+//!     if let Some(count) = session.get::<i32>("counter")? {
+//!         println!("SESSION value: {}", count);
+//!         // modify the session state
+//!         session.insert("counter", count + 1)?;
+//!     } else {
+//!         session.insert("counter", 1)?;
+//!     }
+//!
+//!     Ok("Welcome!")
+//! }
+//! ```
+//!
+//! # Choosing A Backend
+//!
+//! By default, `actix-session` does not provide any storage backend to retrieve and save the state
+//! attached to your sessions. You can enable:
+//!
+//! - a purely cookie-based "backend", [`CookieSessionStore`], using the `cookie-session` feature
+//!   flag.
+//!
+//!   ```toml
+//!   [dependencies]
+//!   # ...
+//!   actix-session = { version = "...", features = ["cookie-session"] }
+//!   ```
+//!
+//! - a Redis-based backend via [`redis-rs`](https://docs.rs/redis-rs), [`RedisSessionStore`], using
+//!   the `redis-session` feature flag.
+//!
+//!   ```toml
+//!   [dependencies]
+//!   # ...
+//!   actix-session = { version = "...", features = ["redis-session"] }
+//!   ```
+//!
+//!   Add the `redis-session-native-tls` feature flag if you want to connect to Redis using a secure
+//!   connection (via the `native-tls` crate):
+//!
+//!   ```toml
+//!   [dependencies]
+//!   # ...
+//!   actix-session = { version = "...", features = ["redis-session-native-tls"] }
+//!   ```
+//!
+//!   If you, instead, prefer depending on `rustls`, use the `redis-session-rustls` feature flag:
+//!
+//!   ```toml
+//!   [dependencies]
+//!   # ...
+//!   actix-session = { version = "...", features = ["redis-session-rustls"] }
+//!   ```
+//!
+//! You can implement your own session storage backend using the [`SessionStore`] trait.
+//!
+//! [`SessionStore`]: storage::SessionStore
+//! [`CookieSessionStore`]: storage::CookieSessionStore
+//! [`RedisSessionStore`]: storage::RedisSessionStore
+//! [`RedisActorSessionStore`]: storage::RedisActorSessionStore
 
 #![forbid(unsafe_code)]
 #![deny(rust_2018_idioms, nonstandard_style)]
diff --git a/trait.impl/core/convert/trait.From.js b/trait.impl/core/convert/trait.From.js
index e6523fc52..56aa06b37 100644
--- a/trait.impl/core/convert/trait.From.js
+++ b/trait.impl/core/convert/trait.From.js
@@ -1,5 +1,5 @@
 (function() {var implementors = {
-"actix_identity":[["impl From<LostIdentityError> for GetIdentityError"],["impl From<MissingIdentityError> for GetIdentityError"],["impl From<SessionExpiryError> for GetIdentityError"],["impl From<SessionGetError> for GetIdentityError"],["impl From<SessionInsertError> for LoginError"]],
+"actix_identity":[["impl From<LostIdentityError> for GetIdentityError"],["impl From<MissingIdentityError> for GetIdentityError"],["impl From<SessionExpiryError> for GetIdentityError"],["impl From<SessionGetError> for GetIdentityError"],["impl From<SessionInsertError> for LoginError"]],
 "actix_limitation":[["impl From<ComponentRange> for Error"],["impl From<RedisError> for Error"]],
 "actix_protobuf":[["impl From<DecodeError> for ProtoBufPayloadError"],["impl From<PayloadError> for ProtoBufPayloadError"]],
 "actix_session":[["impl From<BrowserSession> for SessionLifecycle"],["impl From<PersistentSession> for SessionLifecycle"],["impl From<SessionKey> for String"],["impl From<Error> for SessionGetError"],["impl From<Error> for SessionInsertError"]],