Struct rust_apt::progress::AptAcquireProgress
source · [−]pub struct AptAcquireProgress { /* private fields */ }Expand description
AptAcquireProgress is the default struct for the update method on the cache.
This struct mimics the output of apt update.
Implementations
Trait Implementations
sourceimpl AcquireProgress for AptAcquireProgress
impl AcquireProgress for AptAcquireProgress
sourcefn pulse_interval(&self) -> usize
fn pulse_interval(&self) -> usize
Used to send the pulse interval to the apt progress class.
Pulse Interval is in microseconds.
Example: 1 second = 1000000 microseconds.
Apt default is 500000 microseconds or 0.5 seconds.
The higher the number, the less frequent pulse updates will be.
Pulse Interval set to 0 assumes the apt defaults.
sourcefn hit(&mut self, id: u32, description: String)
fn hit(&mut self, id: u32, description: String)
Called when an item is confirmed to be up-to-date.
Prints out the short description and the expected size.
sourcefn fetch(&mut self, id: u32, description: String, file_size: u64)
fn fetch(&mut self, id: u32, description: String, file_size: u64)
Called when an Item has started to download
Prints out the short description and the expected size.
sourcefn done(&mut self)
fn done(&mut self)
Called when an item is successfully and completely fetched.
We don’t print anything here to remain consistent with apt.
TODO: Pass through information here. Likely when we make a general struct fork the items.
sourcefn start(&mut self)
fn start(&mut self)
Called when progress has started.
Start does not pass information into the method.
We do not print anything here to remain consistent with apt. lastline length is set to 0 to ensure consistency when progress begins.
sourcefn stop(
&mut self,
fetched_bytes: u64,
elapsed_time: u64,
current_cps: u64,
pending_errors: bool
)
fn stop(
&mut self,
fetched_bytes: u64,
elapsed_time: u64,
current_cps: u64,
pending_errors: bool
)
Called when progress has finished.
Stop does not pass information into the method.
prints out the bytes downloaded and the overall average line speed.
sourcefn fail(&mut self, id: u32, description: String, status: u32, error_text: String)
fn fail(&mut self, id: u32, description: String, status: u32, error_text: String)
Called when an Item fails to download.
Print out the ErrorText for the Item.
sourcefn pulse(
&mut self,
workers: Vec<Worker>,
percent: f32,
total_bytes: u64,
current_bytes: u64,
current_cps: u64
)
fn pulse(
&mut self,
workers: Vec<Worker>,
percent: f32,
total_bytes: u64,
current_bytes: u64,
current_cps: u64
)
Called periodically to provide the overall progress information
Draws the current progress. Each line has an overall percent meter and a per active item status meter along with an overall bandwidth and ETA indicator.
sourceimpl Debug for AptAcquireProgress
impl Debug for AptAcquireProgress
sourceimpl Default for AptAcquireProgress
impl Default for AptAcquireProgress
sourcefn default() -> AptAcquireProgress
fn default() -> AptAcquireProgress
Returns the “default value” for a type. Read more
Auto Trait Implementations
impl RefUnwindSafe for AptAcquireProgress
impl Send for AptAcquireProgress
impl Sync for AptAcquireProgress
impl Unpin for AptAcquireProgress
impl UnwindSafe for AptAcquireProgress
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more