Struct generic_async_http_client::Session
source · pub struct Session { /* private fields */ }
Expand description
A helper to perform multiple associated requests. (Session-)Cookies will be handled
Implementations§
source§impl Session
impl Session
pub fn new() -> Session
sourcepub fn set_header(
self,
name: impl TryInto<HeaderName, Error = Error>,
value: impl TryInto<HeaderValue, Error = Error>
) -> Result<Self, Error>
pub fn set_header( self, name: impl TryInto<HeaderName, Error = Error>, value: impl TryInto<HeaderValue, Error = Error> ) -> Result<Self, Error>
Add a single header to all request done with this session
pub fn get(&mut self, uri: &str) -> Request
pub fn post(&mut self, uri: &str) -> Request
pub fn put(&mut self, uri: &str) -> Request
pub fn delete(&mut self, uri: &str) -> Request
pub fn head(&mut self, uri: &str) -> Request
pub fn options(&mut self, uri: &str) -> Request
pub fn request(&mut self, meth: &str, uri: &str) -> Result<Request, Error>
pub fn request_from<R>(&mut self, request: R) -> Result<Request, R::Error>where R: TryInto<Request>,
Trait Implementations§
Auto Trait Implementations§
impl RefUnwindSafe for Session
impl Send for Session
impl Sync for Session
impl Unpin for Session
impl UnwindSafe for Session
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