Struct cookie::Cookie [] [src]

pub struct Cookie {
    pub name: String,
    pub value: String,
    pub expires: Option<Tm>,
    pub max_age: Option<u64>,
    pub domain: Option<String>,
    pub path: Option<String>,
    pub secure: bool,
    pub httponly: bool,
    pub custom: BTreeMap<String, String>,
}

Holds all the data for a single cookie

Fields

Methods

impl Cookie
[src]

Creates a new Cookie instance from key and value strings

Example

use cookie::Cookie;

let c = Cookie::new("foo".into(), "bar".into());
assert_eq!(c.name, "foo");
assert_eq!(c.value, "bar");

Attempts to parse a string into a Cookie instance

Example

use cookie::Cookie;

let c = Cookie::parse("foo=bar; httponly").expect("Failed to parse cookie");
assert_eq!(c.name, "foo");
assert_eq!(c.value, "bar");
assert!(c.httponly);

Returns the (name, value) pair for this Cookie instance

Trait Implementations

impl PartialEq for Cookie
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

impl Clone for Cookie
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl Debug for Cookie
[src]

Formats the value using the given formatter.

impl Display for Cookie
[src]

Formats the value using the given formatter.

impl FromStr for Cookie
[src]

The associated error which can be returned from parsing.

Parses a string s to return a value of this type. Read more