Crate actix_cors
source · [−]Expand description
Cross-Origin Resource Sharing (CORS) controls for Actix Web.
This middleware can be applied to both applications and resources. Once built, a diff --git a/actix_session/storage/enum.LoadError.html b/actix_session/storage/enum.LoadError.html index f27667004..79754321f 100644 --- a/actix_session/storage/enum.LoadError.html +++ b/actix_session/storage/enum.LoadError.html @@ -7,11 +7,11 @@
LoadError
Enum actix_session::storage::LoadError
source · [−]pub enum LoadError {
- Deserialization(Error),
- Other(Error),
+ Deserialization(Error),
+ Other(Error),
}
Expand description
Possible failures modes for SessionStore::load
.
Variants
Deserialization(Error)
Failed to deserialize session state.
-Other(Error)
Something went wrong when retrieving the session state.
+Variants
Deserialization(Error)
Failed to deserialize session state.
+Other(Error)
Something went wrong when retrieving the session state.
Trait Implementations
sourceimpl Error for LoadError
impl Error for LoadError
sourcefn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
The lower-level source of this error, if any. Read more
diff --git a/actix_session/storage/enum.SaveError.html b/actix_session/storage/enum.SaveError.html index f9610b76a..7f84ecc09 100644 --- a/actix_session/storage/enum.SaveError.html +++ b/actix_session/storage/enum.SaveError.html @@ -7,11 +7,11 @@SaveError
Enum actix_session::storage::SaveError
source · [−]pub enum SaveError {
- Serialization(Error),
- Other(Error),
+ Serialization(Error),
+ Other(Error),
}
Expand description
Possible failures modes for SessionStore::save
.
Variants
Serialization(Error)
Failed to serialize session state.
-Other(Error)
Something went wrong when persisting the session state.
+Variants
Serialization(Error)
Failed to serialize session state.
+Other(Error)
Something went wrong when persisting the session state.
Trait Implementations
sourceimpl Error for SaveError
impl Error for SaveError
sourcefn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
The lower-level source of this error, if any. Read more
diff --git a/actix_session/storage/enum.UpdateError.html b/actix_session/storage/enum.UpdateError.html index 289f26b10..bea23efed 100644 --- a/actix_session/storage/enum.UpdateError.html +++ b/actix_session/storage/enum.UpdateError.html @@ -7,11 +7,11 @@UpdateError
Enum actix_session::storage::UpdateError
source · [−]pub enum UpdateError {
- Serialization(Error),
- Other(Error),
+ Serialization(Error),
+ Other(Error),
}
Expand description
Possible failures modes for SessionStore::update
.
Variants
Serialization(Error)
Failed to serialize session state.
-Other(Error)
Something went wrong when updating the session state.
+Variants
Serialization(Error)
Failed to serialize session state.
+Other(Error)
Something went wrong when updating the session state.
Trait Implementations
sourceimpl Debug for UpdateError
impl Debug for UpdateError
sourceimpl Display for UpdateError
impl Display for UpdateError
sourceimpl Error for UpdateError
impl Error for UpdateError
sourcefn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
The lower-level source of this error, if any. Read more
diff --git a/actix_session/storage/struct.CookieSessionStore.html b/actix_session/storage/struct.CookieSessionStore.html index 5f46baf2d..47e766d4f 100644 --- a/actix_session/storage/struct.CookieSessionStore.html +++ b/actix_session/storage/struct.CookieSessionStore.html @@ -40,7 +40,7 @@ storage backend.sourceimpl SessionStore for CookieSessionStore
impl SessionStore for CookieSessionStore
sourcefn load<'life0, 'life1, 'async_trait>(
&'life0 self,
session_key: &'life1 SessionKey
) -> Pin<Box<dyn Future<Output = Result<Option<HashMap<String, String>>, LoadError>> + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
fn load<'life0, 'life1, 'async_trait>(
&'life0 self,
session_key: &'life1 SessionKey
) -> Pin<Box<dyn Future<Output = Result<Option<HashMap<String, String>>, LoadError>> + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
Loads the session state associated to a session key.
sourcefn save<'life0, 'life1, 'async_trait>(
&'life0 self,
session_state: HashMap<String, String>,
_ttl: &'life1 Duration
) -> Pin<Box<dyn Future<Output = Result<SessionKey, SaveError>> + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
fn save<'life0, 'life1, 'async_trait>(
&'life0 self,
session_state: HashMap<String, String>,
_ttl: &'life1 Duration
) -> Pin<Box<dyn Future<Output = Result<SessionKey, SaveError>> + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
Persist the session state for a newly created session. Read more
sourcefn update<'life0, 'life1, 'async_trait>(
&'life0 self,
_session_key: SessionKey,
session_state: HashMap<String, String>,
ttl: &'life1 Duration
) -> Pin<Box<dyn Future<Output = Result<SessionKey, UpdateError>> + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
fn update<'life0, 'life1, 'async_trait>(
&'life0 self,
_session_key: SessionKey,
session_state: HashMap<String, String>,
ttl: &'life1 Duration
) -> Pin<Box<dyn Future<Output = Result<SessionKey, UpdateError>> + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
Updates the session state associated to a pre-existing session key.
-Auto Trait Implementations
impl RefUnwindSafe for CookieSessionStore
impl Send for CookieSessionStore
impl Sync for CookieSessionStore
impl Unpin for CookieSessionStore
impl UnwindSafe for CookieSessionStore
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
diff --git a/actix_session/storage/struct.RedisActorSessionStore.html b/actix_session/storage/struct.RedisActorSessionStore.html index ca4c91e4a..6c199ac52 100644 --- a/actix_session/storage/struct.RedisActorSessionStore.html +++ b/actix_session/storage/struct.RedisActorSessionStore.html @@ -49,7 +49,7 @@ connection string for Redis.Trait Implementations
sourceimpl SessionStore for RedisActorSessionStore
impl SessionStore for RedisActorSessionStore
sourcefn load<'life0, 'life1, 'async_trait>(
&'life0 self,
session_key: &'life1 SessionKey
) -> Pin<Box<dyn Future<Output = Result<Option<HashMap<String, String>>, LoadError>> + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
fn load<'life0, 'life1, 'async_trait>(
&'life0 self,
session_key: &'life1 SessionKey
) -> Pin<Box<dyn Future<Output = Result<Option<HashMap<String, String>>, LoadError>> + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
Loads the session state associated to a session key.
sourcefn save<'life0, 'life1, 'async_trait>(
&'life0 self,
session_state: HashMap<String, String>,
ttl: &'life1 Duration
) -> Pin<Box<dyn Future<Output = Result<SessionKey, SaveError>> + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
fn save<'life0, 'life1, 'async_trait>(
&'life0 self,
session_state: HashMap<String, String>,
ttl: &'life1 Duration
) -> Pin<Box<dyn Future<Output = Result<SessionKey, SaveError>> + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
Persist the session state for a newly created session. Read more
sourcefn update<'life0, 'life1, 'async_trait>(
&'life0 self,
session_key: SessionKey,
session_state: HashMap<String, String>,
ttl: &'life1 Duration
) -> Pin<Box<dyn Future<Output = Result<SessionKey, UpdateError>> + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
fn update<'life0, 'life1, 'async_trait>(
&'life0 self,
session_key: SessionKey,
session_state: HashMap<String, String>,
ttl: &'life1 Duration
) -> Pin<Box<dyn Future<Output = Result<SessionKey, UpdateError>> + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
Updates the session state associated to a pre-existing session key.
-Auto Trait Implementations
impl !RefUnwindSafe for RedisActorSessionStore
impl !Send for RedisActorSessionStore
impl !Sync for RedisActorSessionStore
impl Unpin for RedisActorSessionStore
impl !UnwindSafe for RedisActorSessionStore
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
diff --git a/actix_session/storage/struct.RedisSessionStore.html b/actix_session/storage/struct.RedisSessionStore.html index b7b95b87a..00f566294 100644 --- a/actix_session/storage/struct.RedisSessionStore.html +++ b/actix_session/storage/struct.RedisSessionStore.html @@ -46,7 +46,7 @@ connection to Redis using therediss://
URL scheme:
Implementations
sourceimpl RedisSessionStore
impl RedisSessionStore
sourcepub fn builder<S: Into<String>>(
connection_string: S
) -> RedisSessionStoreBuilder
pub fn builder<S: Into<String>>(
connection_string: S
) -> RedisSessionStoreBuilder
A fluent API to configure RedisSessionStore
.
It takes as input the only required input to create a new instance of RedisSessionStore
- a
connection string for Redis.
sourcepub async fn new<S: Into<String>>(
connection_string: S
) -> Result<RedisSessionStore, Error>
pub async fn new<S: Into<String>>(
connection_string: S
) -> Result<RedisSessionStore, Error>
Create a new instance of RedisSessionStore
using the default configuration.
+
sourcepub async fn new<S: Into<String>>(
connection_string: S
) -> Result<RedisSessionStore, Error>
pub async fn new<S: Into<String>>(
connection_string: S
) -> Result<RedisSessionStore, Error>
Create a new instance of RedisSessionStore
using the default configuration.
It takes as input the only required input to create a new instance of RedisSessionStore
- a
connection string for Redis.
Trait Implementations
sourceimpl Clone for RedisSessionStore
impl Clone for RedisSessionStore
sourcefn clone(&self) -> RedisSessionStore
fn clone(&self) -> RedisSessionStore
Returns a copy of the value. Read more
@@ -54,7 +54,7 @@ connection string for Redis.sourceimpl SessionStore for RedisSessionStore
impl SessionStore for RedisSessionStore
sourcefn load<'life0, 'life1, 'async_trait>(
&'life0 self,
session_key: &'life1 SessionKey
) -> Pin<Box<dyn Future<Output = Result<Option<HashMap<String, String>>, LoadError>> + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
fn load<'life0, 'life1, 'async_trait>(
&'life0 self,
session_key: &'life1 SessionKey
) -> Pin<Box<dyn Future<Output = Result<Option<HashMap<String, String>>, LoadError>> + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
Loads the session state associated to a session key.
sourcefn save<'life0, 'life1, 'async_trait>(
&'life0 self,
session_state: HashMap<String, String>,
ttl: &'life1 Duration
) -> Pin<Box<dyn Future<Output = Result<SessionKey, SaveError>> + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
fn save<'life0, 'life1, 'async_trait>(
&'life0 self,
session_state: HashMap<String, String>,
ttl: &'life1 Duration
) -> Pin<Box<dyn Future<Output = Result<SessionKey, SaveError>> + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
Persist the session state for a newly created session. Read more
sourcefn update<'life0, 'life1, 'async_trait>(
&'life0 self,
session_key: SessionKey,
session_state: HashMap<String, String>,
ttl: &'life1 Duration
) -> Pin<Box<dyn Future<Output = Result<SessionKey, UpdateError>> + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
fn update<'life0, 'life1, 'async_trait>(
&'life0 self,
session_key: SessionKey,
session_state: HashMap<String, String>,
ttl: &'life1 Duration
) -> Pin<Box<dyn Future<Output = Result<SessionKey, UpdateError>> + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
Updates the session state associated to a pre-existing session key.
-Auto Trait Implementations
impl !RefUnwindSafe for RedisSessionStore
impl Send for RedisSessionStore
impl Sync for RedisSessionStore
impl Unpin for RedisSessionStore
impl !UnwindSafe for RedisSessionStore
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
diff --git a/actix_session/storage/struct.RedisSessionStoreBuilder.html b/actix_session/storage/struct.RedisSessionStoreBuilder.html index d3c78a2f6..bc73cc7e4 100644 --- a/actix_session/storage/struct.RedisSessionStoreBuilder.html +++ b/actix_session/storage/struct.RedisSessionStoreBuilder.html @@ -9,7 +9,7 @@Struct actix_session::storage::RedisSessionStoreBuilder
source · [−]pub struct RedisSessionStoreBuilder { /* private fields */ }
Expand description
A fluent builder to construct a RedisSessionStore
instance with custom configuration
parameters.
Implementations
sourceimpl RedisSessionStoreBuilder
impl RedisSessionStoreBuilder
sourcepub fn cache_keygen<F>(self, keygen: F) -> Self where
F: Fn(&str) -> String + 'static + Send + Sync,
pub fn cache_keygen<F>(self, keygen: F) -> Self where
F: Fn(&str) -> String + 'static + Send + Sync,
Set a custom cache key generation strategy, expecting a session key as input.
-sourcepub async fn build(self) -> Result<RedisSessionStore, Error>
pub async fn build(self) -> Result<RedisSessionStore, Error>
Finalise the builder and return a RedisActorSessionStore
instance.
sourcepub async fn build(self) -> Result<RedisSessionStore, Error>
pub async fn build(self) -> Result<RedisSessionStore, Error>
Finalise the builder and return a RedisActorSessionStore
instance.
Auto Trait Implementations
impl !RefUnwindSafe for RedisSessionStoreBuilder
impl Send for RedisSessionStoreBuilder
impl Sync for RedisSessionStoreBuilder
impl Unpin for RedisSessionStoreBuilder
impl !UnwindSafe for RedisSessionStoreBuilder
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
diff --git a/actix_session/storage/trait.SessionStore.html b/actix_session/storage/trait.SessionStore.html index bd9dbbb6f..28b467eb3 100644 --- a/actix_session/storage/trait.SessionStore.html +++ b/actix_session/storage/trait.SessionStore.html @@ -10,13 +10,13 @@ fn load<'life0, 'life1, 'async_trait>(&'life0 self,
session_key: &'life1 SessionKey
) -> Pin<Box<dyn Future<Output = Result<Option<HashMap<String, String>>, LoadError>> + 'async_trait>>
where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait; fn save<'life0, 'life1, 'async_trait>(
&'life0 self,
session_state: HashMap<String, String>,
ttl: &'life1 Duration
) -> Pin<Box<dyn Future<Output = Result<SessionKey, SaveError>> + 'async_trait>>
where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait; fn update<'life0, 'life1, 'async_trait>(
&'life0 self,
session_key: SessionKey,
session_state: HashMap<String, String>,
ttl: &'life1 Duration
) -> Pin<Box<dyn Future<Output = Result<SessionKey, UpdateError>> + 'async_trait>>
where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait; - fn delete<'life0, 'life1, 'async_trait>(
&'life0 self,
session_key: &'life1 SessionKey
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + 'async_trait>>
where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait; + fn delete<'life0, 'life1, 'async_trait>(
&'life0 self,
session_key: &'life1 SessionKey
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + 'async_trait>>
where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait; }
Expand description
The interface to retrieve and save the current session data from/to the chosen storage backend.
You can provide your own custom session store backend by implementing this trait.
Required methods
Loads the session state associated to a session key.
Persist the session state for a newly created session.
Returns the corresponding session key.
fn update<'life0, 'life1, 'async_trait>(
&'life0 self,
session_key: SessionKey,
session_state: HashMap<String, String>,
ttl: &'life1 Duration
) -> Pin<Box<dyn Future<Output = Result<SessionKey, UpdateError>> + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
fn update<'life0, 'life1, 'async_trait>(
&'life0 self,
session_key: SessionKey,
session_state: HashMap<String, String>,
ttl: &'life1 Duration
) -> Pin<Box<dyn Future<Output = Result<SessionKey, UpdateError>> + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
Updates the session state associated to a pre-existing session key.
-Deletes a session from the store.
+