#[non_exhaustive]pub struct Cookie {
pub name: String,
pub value: String,
pub url: Option<String>,
pub domain: String,
pub path: String,
pub expires: f64,
pub http_only: bool,
pub secure: bool,
pub same_site: Option<String>,
}Expand description
Cookie information for storage state.
See: https://playwright.dev/docs/api/class-browser#browser-new-context-option-storage-state
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.name: StringCookie name
value: StringCookie value
url: Option<String>The URL a cookie being added applies to, in place of domain and
path: the driver derives both, and secure, from it. Never set on
a cookie read back from a context.
domain: StringCookie domain (use dot prefix for subdomain matching, e.g., “.example.com”)
path: StringCookie path
expires: f64Unix timestamp in seconds; -1 for session cookies
http_only: boolHTTP-only flag
secure: boolSecure flag
same_site: Option<String>SameSite attribute (“Strict”, “Lax”, “None”)
Implementations§
Source§impl Cookie
impl Cookie
Sourcepub fn url(self, url: impl Into<String>) -> Self
pub fn url(self, url: impl Into<String>) -> Self
The URL the cookie applies to, in place of a domain and path. Clears both, since the driver rejects a cookie that has a URL and either, and setting a domain or path afterwards clears the URL in turn.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Cookie
impl<'de> Deserialize<'de> for Cookie
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for Cookie
impl RefUnwindSafe for Cookie
impl Send for Cookie
impl Sync for Cookie
impl Unpin for Cookie
impl UnsafeUnpin for Cookie
impl UnwindSafe for Cookie
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
Mutably borrows from an owned value. Read more