pub struct HttpResolver { /* private fields */ }Expand description
HTTP-based resolver that calls an endpoint URL.
The URL may contain {{current_sequence}} which is replaced at runtime.
Query params binary_version, platform, arch, and channel are
appended automatically.
Custom headers (e.g. Authorization) are sent on every request.
Expected responses:
- 204 No Content → no update available
- 200 with JSON body →
HotswapManifest
Implementations§
Source§impl HttpResolver
impl HttpResolver
Sourcepub fn new(endpoint: impl Into<String>) -> Self
pub fn new(endpoint: impl Into<String>) -> Self
Create a new resolver with the given endpoint URL template.
Sourcepub fn with_client(endpoint: impl Into<String>, client: Client) -> Self
pub fn with_client(endpoint: impl Into<String>, client: Client) -> Self
Create with a shared reqwest::Client for connection pooling.
Sourcepub fn with_headers(self, headers: HashMap<String, String>) -> Self
pub fn with_headers(self, headers: HashMap<String, String>) -> Self
Add custom headers sent on every check request.
Trait Implementations§
Source§impl HotswapResolver for HttpResolver
impl HotswapResolver for HttpResolver
Auto Trait Implementations§
impl Freeze for HttpResolver
impl !RefUnwindSafe for HttpResolver
impl Send for HttpResolver
impl Sync for HttpResolver
impl Unpin for HttpResolver
impl UnsafeUnpin for HttpResolver
impl !UnwindSafe for HttpResolver
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