pub struct HttpClient { /* private fields */ }Implementations§
Source§impl HttpClient
impl HttpClient
pub fn new() -> Result<Self>
Sourcepub fn normalize_url(url_or_slug: &str) -> String
pub fn normalize_url(url_or_slug: &str) -> String
Normalize provider inputs so bare hosts/slugs become HTTPS URLs.
Sourcepub async fn discover_assets_if_modified_since(
&self,
url_or_slug: &str,
last_upgraded: Option<DateTime<Utc>>,
) -> Result<ConditionalDiscoveryResult>
pub async fn discover_assets_if_modified_since( &self, url_or_slug: &str, last_upgraded: Option<DateTime<Utc>>, ) -> Result<ConditionalDiscoveryResult>
Discover downloadable assets from an HTTP endpoint with optional
If-Modified-Since behavior.
Sourcepub fn file_name_from_url(url: &str) -> String
pub fn file_name_from_url(url: &str) -> String
Derive a filename from URL path segments with a safe fallback.
pub async fn probe_asset(&self, url_or_slug: &str) -> Result<HttpAssetInfo>
pub async fn probe_asset_if_modified_since( &self, url_or_slug: &str, last_upgraded: Option<DateTime<Utc>>, ) -> Result<ConditionalProbeResult>
pub async fn download_file<F>( &self, url: &str, destination: &Path, progress: &mut Option<F>, ) -> Result<()>
Trait Implementations§
Source§impl Clone for HttpClient
impl Clone for HttpClient
Source§fn clone(&self) -> HttpClient
fn clone(&self) -> HttpClient
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for HttpClient
impl !RefUnwindSafe for HttpClient
impl Send for HttpClient
impl Sync for HttpClient
impl Unpin for HttpClient
impl UnsafeUnpin for HttpClient
impl !UnwindSafe for HttpClient
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