[][src]Struct self_update::Download

pub struct Download { /* fields omitted */ }

Download things into files

With optional progress bar

Methods

impl Download[src]

pub fn from_url(url: &str) -> Self[src]

Specify download url

pub fn show_progress(&mut self, b: bool) -> &mut Self[src]

Toggle download progress bar

pub fn set_progress_style(&mut self, progress_style: ProgressStyle) -> &mut Self[src]

Set the progress style

pub fn set_headers(&mut self, headers: HeaderMap) -> &mut Self[src]

Set the download request headers

pub fn download_to<T: Write>(&self, dest: T) -> Result<()>[src]

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 to File

Trait Implementations

impl Debug for Download[src]

Auto Trait Implementations

Blanket Implementations

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 

type Err = <U as TryFrom<T>>::Err