pub struct Update {
pub body: Option<String>,
pub current_version: String,
pub version: String,
pub date: Option<OffsetDateTime>,
pub target: String,
pub download_url: Url,
pub signature: String,
pub raw_json: Value,
pub timeout: Option<Duration>,
pub proxy: Option<Url>,
pub headers: HeaderMap,
/* private fields */
}Fields§
§body: Option<String>Update description
current_version: StringVersion used to check for update
version: StringVersion announced
date: Option<OffsetDateTime>Update publish date
target: StringTarget
download_url: UrlDownload URL announced
signature: StringSignature announced
raw_json: ValueThe raw version of server’s JSON response. Useful if the response contains additional fields that the updater doesn’t handle.
timeout: Option<Duration>Request timeout
proxy: Option<Url>Request proxy
headers: HeaderMapRequest headers
Implementations§
Source§impl Update
impl Update
Sourcepub async fn download<C: FnMut(usize, Option<u64>), D: FnOnce()>(
&self,
on_chunk: C,
on_download_finish: D,
) -> Result<Vec<u8>>
pub async fn download<C: FnMut(usize, Option<u64>), D: FnOnce()>( &self, on_chunk: C, on_download_finish: D, ) -> Result<Vec<u8>>
Downloads the updater package, verifies it then return it as bytes.
Use Update::install to install it
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Update
impl !RefUnwindSafe for Update
impl Send for Update
impl Sync for Update
impl Unpin for Update
impl !UnwindSafe for Update
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