pub struct Request { /* private fields */ }
Expand description
A pipeline request.
A pipeline request is composed by a destination (uri), a method, a collection of headers and a body. Policies are expected to enrich the request by mutating it.
Implementations§
source§impl Request
impl Request
sourcepub fn new(url: Url, method: Method) -> Self
pub fn new(url: Url, method: Method) -> Self
Create a new request with an empty body and no headers
pub fn url(&self) -> &Url
pub fn url_mut(&mut self) -> &mut Url
pub fn path_and_query(&self) -> String
pub fn method(&self) -> &Method
pub fn insert_headers<T: AsHeaders>(&mut self, headers: &T)
pub fn headers(&self) -> &Headers
pub fn body(&self) -> &Body
pub fn set_json<T>(&mut self, data: &T) -> Result<()>
pub fn set_body(&mut self, body: impl Into<Body>)
pub fn insert_header<K, V>(&mut self, key: K, value: V)
pub fn add_optional_header<T: Header>(&mut self, item: &Option<T>)
pub fn add_mandatory_header<T: Header>(&mut self, item: &T)
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for Request
impl !RefUnwindSafe for Request
impl Send for Request
impl Sync for Request
impl Unpin for Request
impl !UnwindSafe for Request
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)