hf_hub::api

Trait Progress

Source
pub trait Progress {
    // Required methods
    fn init(&mut self, size: usize, filename: &str);
    fn update(&mut self, size: usize);
    fn finish(&mut self);
}
Expand description

This trait is used by users of the lib to implement custom behavior during file downloads

Required Methods§

Source

fn init(&mut self, size: usize, filename: &str)

At the start of the download The size is the total size in bytes of the file.

Source

fn update(&mut self, size: usize)

This function is called whenever size bytes have been downloaded in the temporary file

Source

fn finish(&mut self)

This is called at the end of the download

Implementations on Foreign Types§

Source§

impl Progress for ()

Source§

fn init(&mut self, _size: usize, _filename: &str)

Source§

fn update(&mut self, _size: usize)

Source§

fn finish(&mut self)

Source§

impl Progress for ProgressBar

Source§

fn init(&mut self, size: usize, filename: &str)

Source§

fn update(&mut self, size: usize)

Source§

fn finish(&mut self)

Implementors§