pub struct HttpRequest {
pub method: &'static str,
pub path: String,
pub headers: Vec<(String, String)>,
pub body: Vec<u8>,
pub timeout: Option<Duration>,
}Expand description
One request, already fully addressed: absolute URL, every header, whole body.
Owned rather than borrowed because a backend may need to move it into a spawned task, and a recorder needs to keep it after the call returns.
Fields§
§method: &'static str§path: StringPath plus query string. Not a full URL: the base is the backend’s, so a rebound endpoint changes one field rather than every call site.
headers: Vec<(String, String)>§body: Vec<u8>§timeout: Option<Duration>How long the whole exchange may take. None means the backend’s default.
Implementations§
Trait Implementations§
Source§impl Clone for HttpRequest
impl Clone for HttpRequest
Source§fn clone(&self) -> HttpRequest
fn clone(&self) -> HttpRequest
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for HttpRequest
Names the headers, never their values, and sizes the body rather than printing it.
impl Debug for HttpRequest
Names the headers, never their values, and sizes the body rather than printing it.
Every request on this seam carries authorization: Bearer <agent token>, and a
streaming attach also carries the minted X-aws-proxy-auth — so a derived Debug puts
two credentials in any log line, error chain, or test-failure message that formats a
request. Redacting all header values rather than allowlisting the two known ones,
because an allowlist is a list somebody has to remember to extend the next time the
platform adds a header, and the platform’s stated reason for a token map is that it
may need more than one.
The body is sized rather than shown for the same reason: an upload body is file contents, a stdin body is base64 of whatever the caller is feeding a child, and neither belongs in a log.
Auto Trait Implementations§
impl Freeze for HttpRequest
impl RefUnwindSafe for HttpRequest
impl Send for HttpRequest
impl Sync for HttpRequest
impl Unpin for HttpRequest
impl UnsafeUnpin for HttpRequest
impl UnwindSafe for HttpRequest
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more