pub struct FetchConfig {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: f64,
pub timeout: f64,
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
Outbound-request policy for the fetch builtin ([fetch] section).
By default, requests to loopback/private/link-local addresses are
refused (SSRF protection) and every redirect hop is re-checked.
Fields§
§allowed_hosts: Option<Vec<String>>When set, only these exact host names may be fetched.
allow_private_networks: boolAllow requests to private/loopback/link-local addresses.
private_hosts: Vec<String>Host names that may resolve to a private address while
allow_private_networks stays off: the service next door, named,
rather than every address on the network.
max_response_bytes: u64Maximum response body accumulated by resp:text()/resp:json().
max_concurrent: usizeMaximum concurrent requests per await_all(...) call.
max_per_request: u32Maximum outbound requests one inbound request may make in total.
max_concurrent bounds a single await_all; this bounds the whole
handler, including a loop issuing calls one after another. 0
removes the cap.
connect_timeout: f64Seconds to wait for a TCP/TLS connection to an upstream.
timeout: f64Default total budget per outbound request, in seconds. A per-call
timeout option overrides it.
pool_max_idle_per_host: usizeIdle connections kept per upstream host.
max_retries: u32Maximum retry attempts a call may ask for. Retries are opt-in per call and only ever applied to idempotent methods.
proxy: Option<String>Proxy URL for outbound requests. Unset reads the conventional
HTTPS_PROXY/HTTP_PROXY/ALL_PROXY environment variables.
no_proxy: boolIgnore the proxy environment variables entirely.
propagate_trace_context: boolForward a W3C traceparent header on outbound calls, derived from
the inbound request id, so a request crossing services can be
correlated. Pass-through only: this is not a tracing SDK.
Implementations§
Source§impl FetchConfig
impl FetchConfig
Sourcepub fn options(&self) -> FetchOptions
pub fn options(&self) -> FetchOptions
The runtime policy handed to the fetch builtin.
Trait Implementations§
Source§impl Clone for FetchConfig
impl Clone for FetchConfig
Source§impl Debug for FetchConfig
impl Debug for FetchConfig
Source§impl Default for FetchConfig
impl Default for FetchConfig
Source§impl<'de> Deserialize<'de> for FetchConfigwhere
FetchConfig: Default,
impl<'de> Deserialize<'de> for FetchConfigwhere
FetchConfig: Default,
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Auto Trait Implementations§
impl Freeze for FetchConfig
impl RefUnwindSafe for FetchConfig
impl Send for FetchConfig
impl Sync for FetchConfig
impl Unpin for FetchConfig
impl UnsafeUnpin for FetchConfig
impl UnwindSafe for FetchConfig
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,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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