re-export cookie_store::CookieStore
This commit is contained in:
parent
6c778fbf04
commit
3f97525a64
2 changed files with 7 additions and 5 deletions
|
@ -3,7 +3,7 @@
|
|||
`reqwest_cookie_store` provides implementations of `reqwest::cookie::CookieStore` for [cookie_store](https://crates.io/crates/cookie_store).
|
||||
|
||||
# Example
|
||||
The following example demonstrates loading a `cookie_store::CookieStore` from disk, and using it within a
|
||||
The following example demonstrates loading a `cookie_store::CookieStore` (re-exported in this crate) from disk, and using it within a
|
||||
`CookieStoreMutex`. It then makes a series of requests, examining and modifying the contents
|
||||
of the underlying `cookie_store::CookieStore` in between.
|
||||
|
||||
|
@ -13,7 +13,8 @@ let cookie_store = {
|
|||
let file = std::fs::File::open("cookies.json")
|
||||
.map(std::io::BufReader::new)
|
||||
.unwrap();
|
||||
cookie_store::CookieStore::load_json(file).unwrap()
|
||||
// use re-exported version of `CookieStore` for crate compatibility
|
||||
reqwest_cookie_store::CookieStore::load_json(file).unwrap()
|
||||
};
|
||||
let cookie_store = reqwest_cookie_store::CookieStoreMutex::new(cookie_store);
|
||||
let cookie_store = std::sync::Arc::new(cookie_store);
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
#![deny(warnings, missing_debug_implementations, rust_2018_idioms)]
|
||||
#![cfg_attr(docsrs, feature(doc_cfg))]
|
||||
//! # Example
|
||||
//! The following example demonstrates loading a [`cookie_store::CookieStore`] from disk, and using it within a
|
||||
//! The following example demonstrates loading a [`cookie_store::CookieStore`] (re-exported in this crate) from disk, and using it within a
|
||||
//! [`CookieStoreMutex`]. It then makes a series of requests, examining and modifying the contents
|
||||
//! of the underlying [`cookie_store::CookieStore`] in between.
|
||||
//! ```no_run
|
||||
|
@ -12,7 +12,8 @@
|
|||
//! let file = std::fs::File::open("cookies.json")
|
||||
//! .map(std::io::BufReader::new)
|
||||
//! .unwrap();
|
||||
//! cookie_store::CookieStore::load_json(file).unwrap()
|
||||
//! // use re-exported version of `CookieStore` for crate compatibility
|
||||
//! reqwest_cookie_store::CookieStore::load_json(file).unwrap()
|
||||
//! };
|
||||
//! let cookie_store = reqwest_cookie_store::CookieStoreMutex::new(cookie_store);
|
||||
//! let cookie_store = std::sync::Arc::new(cookie_store);
|
||||
|
@ -80,7 +81,7 @@ use std::{
|
|||
|
||||
use bytes::Bytes;
|
||||
use cookie::{Cookie as RawCookie, ParseError as RawCookieParseError};
|
||||
use cookie_store::CookieStore;
|
||||
pub use cookie_store::CookieStore;
|
||||
use reqwest::header::HeaderValue;
|
||||
use url;
|
||||
|
||||
|
|
Loading…
Reference in a new issue