pub struct CookieJarBuilder { /* private fields */ }Expand description
A netscape cookie parser
allowing generating a new CookieJar or writing to an exist one.
Implementations§
Source§impl CookieJarBuilder
impl CookieJarBuilder
Sourcepub fn new() -> Self
pub fn new() -> Self
Creates a new CookieJarBuilder
use nescookie::CookieJarBuilder;
let jar = CookieJarBuilder::new().finish();Sourcepub fn with_jar(jar: CookieJar) -> Self
pub fn with_jar(jar: CookieJar) -> Self
Creates a new CookieJarBuilder from a CookieJar
parsed cookies will be added to it
Sourcepub fn open(self, path: impl AsRef<Path>) -> Result<Self, Error>
pub fn open(self, path: impl AsRef<Path>) -> Result<Self, Error>
Opens a file with path and parses it as cookies
use nescookie::CookieJarBuilder;
let jar = CookieJarBuilder::new().open("tests/cookies.txt").unwrap().finish();Sourcepub fn parse_buffer(self, buf: impl BufRead) -> Result<Self, Error>
pub fn parse_buffer(self, buf: impl BufRead) -> Result<Self, Error>
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();Trait Implementations§
Source§impl Debug for CookieJarBuilder
impl Debug for CookieJarBuilder
Source§impl Default for CookieJarBuilder
impl Default for CookieJarBuilder
Source§fn default() -> CookieJarBuilder
fn default() -> CookieJarBuilder
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for CookieJarBuilder
impl RefUnwindSafe for CookieJarBuilder
impl Send for CookieJarBuilder
impl Sync for CookieJarBuilder
impl Unpin for CookieJarBuilder
impl UnwindSafe for CookieJarBuilder
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