pub struct FetchOptions {Show 13 fields
pub allowed_hosts: Option<Vec<String>>,
pub allow_private_networks: bool,
pub private_hosts: Vec<String>,
pub max_response_bytes: u64,
pub max_concurrent: usize,
pub max_per_request: u32,
pub connect_timeout: Duration,
pub timeout: Duration,
pub pool_max_idle_per_host: usize,
pub max_retries: u32,
pub proxy: Option<String>,
pub no_proxy: bool,
pub propagate_trace_context: bool,
}Expand description
Policy and limits applied to every outbound fetch request.
None of this is reachable from Lua: a script declares intent (a timeout, a retry count) but cannot widen its own policy or uncap its budget.
Fields§
§allowed_hosts: Option<Vec<String>>When set, only these exact host names may be fetched (compared case-insensitively; applies to every redirect hop).
allow_private_networks: boolAllow requests to loopback/private/link-local addresses. Off by default; enable for trusted internal aggregation.
private_hosts: Vec<String>Host names that may resolve to a private address while
allow_private_networks stays off: the sidecar or the service next
door, compared case-insensitively against the URL’s host and
applied to every redirect hop.
max_response_bytes: u64Maximum response body size accumulated by resp:text() /
resp:json(), in bytes.
max_concurrent: usizeMaximum concurrent requests per await_all(...) call.
max_per_request: u32Maximum outbound requests one inbound request may make in total.
0 removes the cap.
connect_timeout: DurationHow long to wait for a TCP/TLS connection to an upstream.
timeout: DurationDefault total budget per outbound request.
pool_max_idle_per_host: usizeIdle connections kept per upstream host.
max_retries: u32Ceiling on the retry.attempts a call may ask for.
proxy: Option<String>Explicit proxy URL; None uses the environment variables unless
no_proxy is set.
no_proxy: boolIgnore the proxy environment variables.
propagate_trace_context: boolForward a W3C traceparent derived from the inbound request id.
Trait Implementations§
Source§impl Clone for FetchOptions
impl Clone for FetchOptions
Source§impl Debug for FetchOptions
impl Debug for FetchOptions
Auto Trait Implementations§
impl Freeze for FetchOptions
impl RefUnwindSafe for FetchOptions
impl Send for FetchOptions
impl Sync for FetchOptions
impl Unpin for FetchOptions
impl UnsafeUnpin for FetchOptions
impl UnwindSafe for FetchOptions
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