Struct poem::session::CookieConfig
source · pub struct CookieConfig { /* private fields */ }
Available on crate feature
session
only.Expand description
Cookie configuration for session.
Implementations§
source§impl CookieConfig
impl CookieConfig
sourcepub fn path(self, value: impl Into<String>) -> Self
pub fn path(self, value: impl Into<String>) -> Self
Sets the Path
to the session cookie. Default is /
.
sourcepub fn secure(self, value: bool) -> Self
pub fn secure(self, value: bool) -> Self
Sets the Secure
to the session cookie. Default is true
.
sourcepub fn http_only(self, value: bool) -> Self
pub fn http_only(self, value: bool) -> Self
Sets the HttpOnly
to the session cookie. Default is true
.
sourcepub fn same_site(self, value: impl Into<Option<SameSite>>) -> Self
pub fn same_site(self, value: impl Into<Option<SameSite>>) -> Self
Sets the SameSite
to the session cookie.
sourcepub fn max_age(self, value: impl Into<Option<Duration>>) -> Self
pub fn max_age(self, value: impl Into<Option<Duration>>) -> Self
Sets the MaxAge
to the session cookie.
Set the cookie value to CookieJar
.
Remove the cookie from CookieJar
.
Gets the cookie value from CookieJar
.
Trait Implementations§
Auto Trait Implementations§
impl RefUnwindSafe for CookieConfig
impl Send for CookieConfig
impl Sync for CookieConfig
impl Unpin for CookieConfig
impl UnwindSafe for CookieConfig
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere T: 'a,
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
Mutably borrows from an owned value. Read more
source§impl<T> FutureExt for T
impl<T> FutureExt for T
source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
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> TowerCompatExt for T
impl<T> TowerCompatExt for T
source§fn compat<ResBody, Err, Fut>(self) -> TowerCompatEndpoint<Self>where
ResBody: HttpBody + Send + 'static,
ResBody::Data: Into<Bytes> + Send + 'static,
ResBody::Error: StdError + Send + Sync + 'static,
Err: Into<Error>,
Self: Service<Request<Body>, Response = Response<ResBody>, Error = Err, Future = Fut> + Clone + Send + Sync + Sized + 'static,
Fut: Future<Output = Result<Response<ResBody>, Err>> + Send + 'static,
fn compat<ResBody, Err, Fut>(self) -> TowerCompatEndpoint<Self>where ResBody: HttpBody + Send + 'static, ResBody::Data: Into<Bytes> + Send + 'static, ResBody::Error: StdError + Send + Sync + 'static, Err: Into<Error>, Self: Service<Request<Body>, Response = Response<ResBody>, Error = Err, Future = Fut> + Clone + Send + Sync + Sized + 'static, Fut: Future<Output = Result<Response<ResBody>, Err>> + Send + 'static,
Available on crate feature
tower-compat
only.Converts a tower service to a poem endpoint.