pub struct CookieLayer { /* private fields */ }Available on crate features
client and cookie only.Expand description
Layer for extracting and setting cookies.
See CookieLayer::new for more details.
Implementations§
Source§impl CookieLayer
impl CookieLayer
Sourcepub fn new(cookie_store: CookieStore) -> Self
pub fn new(cookie_store: CookieStore) -> Self
Create a new CookieLayer with the given CookieStore.
It will set cookies from the CookieStore into the request
header before sending the request,
and store cookies after receiving the response.
It is recommended to use CookieLayer as the innermost layer in the client stack
since it will extract cookies from the request header and store them before and after call
the transport layer.
§Example
use volo_http::{Client, client::cookie::CookieLayer};
let client: Client = Client::builder()
.layer_inner(CookieLayer::new(Default::default()))
.build()
.unwrap();Trait Implementations§
Auto Trait Implementations§
impl !Freeze for CookieLayer
impl !RefUnwindSafe for CookieLayer
impl Send for CookieLayer
impl Sync for CookieLayer
impl Unpin for CookieLayer
impl !UnwindSafe for CookieLayer
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