pub struct Response {
pub status: StatusCode,
pub headers: HeaderMap,
pub body: Bytes,
}Expand description
What an endpoint answered.
Reported, not interpreted: whether a status is success, worth retrying, or
permanent is the caller’s policy, and it differs between admission and
hooks. The one exception is Self::retry_after, which parses a header
rather than deciding anything with it.
Fields§
§status: StatusCode§headers: HeaderMap§body: BytesImplementations§
Source§impl Response
impl Response
Sourcepub fn retry_after(&self, maximum: Duration) -> Option<Duration>
pub fn retry_after(&self, maximum: Duration) -> Option<Duration>
Retry-After in its delta-seconds form, capped by the caller.
Only the seconds form. The HTTP-date alternative needs a parsed clock to mean anything, and an endpoint that answers an event POST with an absolute date is not a case worth carrying a date parser for; treating it as absent falls back to the caller’s own backoff, which is safe.
Trait Implementations§
impl Eq for Response
impl StructuralPartialEq for Response
Auto Trait Implementations§
impl !Freeze for Response
impl Forget for Response
impl Move for Response
impl RefUnwindSafe for Response
impl Send for Response
impl Sync for Response
impl Unpin for Response
impl UnsafeUnpin for Response
impl UnwindSafe for Response
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