Struct nescookie::CookieJarBuilder[][src]

pub struct CookieJarBuilder { /* fields omitted */ }
Expand description

A netscape cookie parser allowing generating a new CookieJar or writing to an exist one.

Implementations

Creates a new CookieJarBuilder

use nescookie::CookieJarBuilder;

let jar = CookieJarBuilder::new().finish();

Creates a new CookieJarBuilder from a CookieJar parsed cookies will be added to it

Opens a file with path and parses it as cookies

use nescookie::CookieJarBuilder;

let jar = CookieJarBuilder::new().open("tests/cookies.txt").unwrap().finish();

Parses cookies from something that implements BufRead

use nescookie::CookieJarBuilder;
use std::io::Cursor;

let buf = Cursor::new(b".pixiv.net	TRUE	/	TRUE	1784339332	p_ab_id	7\n");
let jar = CookieJarBuilder::new().parse_buffer(buf).unwrap().finish();

Parses cookies from an str

use nescookie::CookieJarBuilder;

let content = ".pixiv.net	TRUE	/	TRUE	1784339332	p_ab_id	7\n";
let jar = CookieJarBuilder::new().parse(content).unwrap().finish();

Returns the built CookieJar

Trait Implementations

Formats the value using the given formatter. Read more

Returns the “default value” for a type. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.