Cookie
2025年7月17日小于 1 分钟hyperlanewebrusttypeCookie
提示
hyperlane
框架的 Cookie
相关类型定义如下
/// The raw cookie string from the HTTP request header.
pub type CookieString = String;
/// Key type used in the request cookies.
pub type CookieKey = String;
/// Value type used in the request cookies.
pub type CookieValue = String;
/// Optional value for a cookie.
pub type OptionCookiesValue = Option<CookieValue>;
/// Optional expiration date string for a cookie.
pub type OptionCookieExpires = Option<String>;
/// Optional maximum age in seconds for a cookie.
pub type OptionCookieMaxAge = Option<i64>;
/// Optional domain for a cookie.
pub type OptionCookieDomain = Option<String>;
/// Optional path for a cookie.
pub type OptionCookiePath = Option<String>;
/// Optional SameSite policy for a cookie.
pub type OptionCookieSameSite = Option<String>;
// A collection of cookies.
pub type Cookies = HashMapXxHash3_64<CookieKey, CookieValue>;
/// A builder for constructing HTTP cookies with various attributes.
#[derive(Debug, Clone, Default)]
pub struct CookieBuilder {
/// The name of the cookie.
pub(super) name: CookieKey,
/// The value of the cookie.
pub(super) value: CookieValue,
/// Optional expiration date string (e.g., "Wed, 21 Oct 2015 07:28:00 GMT").
pub(super) expires: OptionCookieExpires,
/// Optional maximum age in seconds.
pub(super) max_age: OptionCookieMaxAge,
/// Optional domain for the cookie.
pub(super) domain: OptionCookieDomain,
/// Optional path for the cookie.
pub(super) path: OptionCookiePath,
/// Whether the cookie should only be sent over HTTPS.
pub(super) secure: bool,
/// Whether the cookie should be inaccessible to JavaScript.
pub(super) http_only: bool,
/// Optional SameSite policy ("Strict", "Lax", or "None").
pub(super) same_site: OptionCookieSameSite,
}
/// A simple cookie structure for parsing HTTP Cookie headers.
#[derive(Debug, Clone, Default)]
pub struct Cookie;