Struct self_update::Download
[−]
[src]
pub struct Download { /* fields omitted */ }
Download things into files
Methods
impl Download
[src]
fn from_url(url: &str) -> Self
Specify download url
fn show_progress(&mut self, b: bool) -> &mut Self
Toggle download progress bar
fn download_to<T: Write>(&self, dest: T) -> Result<()>
Download the file behind the given url
into the specified dest
.
Show a sliding progress bar if specified.
If the resource doesn't specify a content-length, the progress bar will not be shown
- Errors:
reqwest
network errors- Unsuccessful response status
- Progress-bar errors
- Reading from response to
BufReader
-buffer - Writing from
BufReader
-buffer toFile