Struct 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§

Source§

impl AptAcquireProgress

Source

pub fn new() -> Self

Returns a new default progress instance.

Source

pub fn disable() -> Self

Returns a disabled progress instance. No output will be shown.

Trait Implementations§

Source§

impl Debug for AptAcquireProgress

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for AptAcquireProgress

Source§

fn default() -> AptAcquireProgress

Returns the “default value” for a type. Read more
Source§

impl DynAcquireProgress for AptAcquireProgress

Source§

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.

Source§

fn hit(&mut self, item: &ItemDesc)

Called when an item is confirmed to be up-to-date.

Prints out the short description and the expected size.

Source§

fn fetch(&mut self, item: &ItemDesc)

Called when an Item has started to download

Prints out the short description and the expected size.

Source§

fn done(&mut self, _item: &ItemDesc)

Called when an item is successfully and completely fetched.

We don’t print anything here to remain consistent with apt.

Source§

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.

Source§

fn stop(&mut self, owner: &AcqTextStatus)

Called when progress has finished.

Stop does not pass information into the method.

prints out the bytes downloaded and the overall average line speed.

Source§

fn fail(&mut self, item: &ItemDesc)

Called when an Item fails to download.

Print out the ErrorText for the Item.

Source§

fn pulse(&mut self, status: &AcqTextStatus, owner: &PkgAcquire)

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.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

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

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

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

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.