Struct lychee_lib::CookieJar
source · pub struct CookieJar { /* private fields */ }Expand description
A wrapper around reqwest_cookie_store::CookieStore
We keep track of the file path of the cookie store and
implement PartialEq to compare cookie jars by their path
Implementations§
source§impl CookieJar
impl CookieJar
sourcepub fn load(path: PathBuf) -> Result<Self>
pub fn load(path: PathBuf) -> Result<Self>
Load a cookie store from a file
Currently only JSON files are supported
§Errors
This function will return an error if
- the file cannot be opened or
- if the file is not valid JSON
sourcepub fn save(&self) -> Result<()>
pub fn save(&self) -> Result<()>
Save the cookie store to file as JSON This will overwrite the file, which was loaded if any
§Errors
This function will return an error if
- the cookie store is locked or
- the file cannot be opened or
- if the file cannot be written to or
- if the file cannot be serialized to JSON
Trait Implementations§
Auto Trait Implementations§
impl RefUnwindSafe for CookieJar
impl Send for CookieJar
impl Sync for CookieJar
impl Unpin for CookieJar
impl UnwindSafe for CookieJar
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