http_type/cookie/
struct.rs

1use crate::*;
2
3/// Builder for constructing HTTP cookies.
4///
5/// Provides methods to set various cookie attributes like expiration,
6/// domain, path, and security flags before building the final cookie string.
7#[derive(Debug, Clone, Default, PartialEq, Eq)]
8pub struct CookieBuilder {
9    /// Cookie name identifier.
10    pub(super) name: CookieKey,
11    /// Cookie value content.
12    pub(super) value: CookieValue,
13    /// Optional expiration date/time string.
14    pub(super) expires: OptionCookieExpires,
15    /// Optional maximum age in seconds.
16    pub(super) max_age: OptionCookieMaxAge,
17    /// Optional domain scope for the cookie.
18    pub(super) domain: OptionCookieDomain,
19    /// Optional path scope for the cookie.
20    pub(super) path: OptionCookiePath,
21    /// Flag indicating secure (HTTPS-only) transmission.
22    pub(super) secure: bool,
23    /// Flag preventing JavaScript access.
24    pub(super) http_only: bool,
25    /// Optional SameSite policy setting.
26    pub(super) same_site: OptionCookieSameSite,
27}
28
29/// Parser for HTTP Cookie headers.
30///
31/// Provides functionality to parse Cookie header strings into key-value pairs.
32#[derive(Debug, Clone, Default, PartialEq, Eq)]
33pub struct Cookie;