pub struct PgNtexSession<SE: StateEncryption + Clone>(/* private fields */);Implementations§
Source§impl<SE: StateEncryption + Clone> PgNtexSession<SE>
impl<SE: StateEncryption + Clone> PgNtexSession<SE>
Sourcepub fn new(
key: impl AsRef<[u8]>,
encryption_engine: Option<SE>,
pooled_connection: Arc<Pool<ConnectionManager<PgConnection>>>,
) -> Self
pub fn new( key: impl AsRef<[u8]>, encryption_engine: Option<SE>, pooled_connection: Arc<Pool<ConnectionManager<PgConnection>>>, ) -> Self
Construct new signed PgNtexSession instance.
You can use UUID v4 as encryption key.
Panics if key length is less than 32 bytes.
pooled_connection is a Pool of Postgres Connection Manager. Check r2d2 Pool sample and ConnectionManager sample
Sourcepub fn path<S: Into<String>>(self, value: S) -> Self
pub fn path<S: Into<String>>(self, value: S) -> Self
Sets the path field in the session cookie being built.
Sourcepub fn name<S: Into<String>>(self, value: S) -> Self
pub fn name<S: Into<String>>(self, value: S) -> Self
Sets the name field in the session cookie being built.
Sourcepub fn domain<S: Into<String>>(self, value: S) -> Self
pub fn domain<S: Into<String>>(self, value: S) -> Self
Sets the domain field in the session cookie being built.
Sourcepub fn secure(self, value: bool) -> Self
pub fn secure(self, value: bool) -> Self
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
Sourcepub fn http_only(self, value: bool) -> Self
pub fn http_only(self, value: bool) -> Self
Sets the http_only field in the session cookie being built.
Sourcepub fn same_site(self, value: SameSite) -> Self
pub fn same_site(self, value: SameSite) -> Self
Sets the same_site field in the session cookie being built.
Sourcepub fn max_age(self, seconds: u64) -> Self
pub fn max_age(self, seconds: u64) -> Self
Sets the max-age field in the session cookie being built.
Sourcepub fn max_age_time(self, value: Duration) -> Self
pub fn max_age_time(self, value: Duration) -> Self
Sets the max-age field in the session cookie being built.
Sourcepub fn expires_in(self, seconds: u64) -> Self
pub fn expires_in(self, seconds: u64) -> Self
Sets the expires field in the session cookie being built.
Sourcepub fn expires_in_time(self, value: Duration) -> Self
pub fn expires_in_time(self, value: Duration) -> Self
Sets the expires field in the session cookie being built.
Trait Implementations§
Source§impl<S, SE: StateEncryption + Clone> Middleware<S> for PgNtexSession<SE>
impl<S, SE: StateEncryption + Clone> Middleware<S> for PgNtexSession<SE>
Auto Trait Implementations§
impl<SE> !Send for PgNtexSession<SE>
impl<SE> !Sync for PgNtexSession<SE>
impl<SE> Freeze for PgNtexSession<SE>
impl<SE> RefUnwindSafe for PgNtexSession<SE>where
SE: RefUnwindSafe,
impl<SE> Unpin for PgNtexSession<SE>
impl<SE> UnsafeUnpin for PgNtexSession<SE>
impl<SE> UnwindSafe for PgNtexSession<SE>where
SE: RefUnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoSql for T
impl<T> IntoSql for T
Source§fn into_sql<T>(self) -> Self::Expression
fn into_sql<T>(self) -> Self::Expression
self to an expression for Diesel’s query builder. Read moreSource§fn as_sql<'a, T>(&'a self) -> <&'a Self as AsExpression<T>>::Expression
fn as_sql<'a, T>(&'a self) -> <&'a Self as AsExpression<T>>::Expression
&self to an expression for Diesel’s query builder. Read more