pub struct Fetcher { /* private fields */ }Expand description
HTTP fetcher with SSRF protection and retry logic.
Implementations§
Source§impl Fetcher
impl Fetcher
Sourcepub fn with_config(ssrf: SsrfGuard, config: FetcherConfig) -> Result<Self>
pub fn with_config(ssrf: SsrfGuard, config: FetcherConfig) -> Result<Self>
Creates a fetcher with a custom configuration.
Sourcepub async fn fetch(&self, url: &str) -> Result<Value>
pub async fn fetch(&self, url: &str) -> Result<Value>
Fetches and deserialises a JSON response from url.
Validates the URL with the SSRF guard before sending, and retries on transient network errors using exponential back-off.
Sourcepub fn reqwest_client(&self) -> Client
pub fn reqwest_client(&self) -> Client
Exposes the inner reqwest::Client so Bootstrap can reuse it.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Fetcher
impl !RefUnwindSafe for Fetcher
impl Send for Fetcher
impl Sync for Fetcher
impl Unpin for Fetcher
impl UnsafeUnpin for Fetcher
impl !UnwindSafe for Fetcher
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