pub struct HttpPolicy {
pub max_response_bytes: usize,
pub timeout: Duration,
}Expand description
Per-operation outbound bounds, attached to a request as an extension
and resolved by every implementation with HttpPolicy::of_request.
Both fields clamp to the port maxima: a caller may only tighten.
Fields§
§max_response_bytes: usizeMaximum accepted response body size.
timeout: DurationMaximum time to wait for the upstream to answer.
Implementations§
Source§impl HttpPolicy
impl HttpPolicy
Sourcepub fn of_request<T>(request: &Request<T>) -> Self
pub fn of_request<T>(request: &Request<T>) -> Self
The effective policy for request: the attached HttpPolicy
extension if any, clamped to the port ceilings.
Sourcepub fn clamped(self) -> Self
pub fn clamped(self) -> Self
Clamps to MAX_RESPONSE_BYTES / MAX_RESPONSE_TIMEOUT:
callers may lower a bound, never raise it.
Trait Implementations§
Source§impl Clone for HttpPolicy
impl Clone for HttpPolicy
Source§fn clone(&self) -> HttpPolicy
fn clone(&self) -> HttpPolicy
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for HttpPolicy
Source§impl Debug for HttpPolicy
impl Debug for HttpPolicy
Source§impl Default for HttpPolicy
impl Default for HttpPolicy
impl Eq for HttpPolicy
Source§impl PartialEq for HttpPolicy
impl PartialEq for HttpPolicy
impl StructuralPartialEq for HttpPolicy
Auto Trait Implementations§
impl Freeze for HttpPolicy
impl RefUnwindSafe for HttpPolicy
impl Send for HttpPolicy
impl Sync for HttpPolicy
impl Unpin for HttpPolicy
impl UnsafeUnpin for HttpPolicy
impl UnwindSafe for HttpPolicy
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§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.