pub struct RequestSpec {
pub method: Method,
pub path: String,
pub query: Vec<(&'static str, String)>,
pub headers: Vec<(&'static str, String)>,
pub body: Option<Vec<u8>>,
}Expand description
A concrete HTTP request, built once from an Operation and consumed by
whichever executor performs the IO.
Fields§
§method: Method§path: String§query: Vec<(&'static str, String)>§headers: Vec<(&'static str, String)>§body: Option<Vec<u8>>Implementations§
Source§impl RequestSpec
impl RequestSpec
Sourcepub fn build<O: Operation>(op: &O) -> Result<Self>
pub fn build<O: Operation>(op: &O) -> Result<Self>
Resolve an Operation into a concrete request.
Sourcepub fn is_mutating(&self) -> bool
pub fn is_mutating(&self) -> bool
Whether this request mutates server state (anything but GET/HEAD/
OPTIONS). Used to decide when an idempotency key is warranted.
Sourcepub fn ensure_idempotency_key(&mut self)
pub fn ensure_idempotency_key(&mut self)
Attach an Idempotency-Key header to a mutating request if it doesn’t
already carry one, so that automatic retries cannot duplicate side
effects. No-op for non-mutating requests or when a key is already set.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for RequestSpec
impl RefUnwindSafe for RequestSpec
impl Send for RequestSpec
impl Sync for RequestSpec
impl Unpin for RequestSpec
impl UnsafeUnpin for RequestSpec
impl UnwindSafe for RequestSpec
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