a8m / a8m/pb

Add support for setting/changing total after creation

Ouverte
#43 1 commentaire 1 réaction 0 personnes assignées Voir sur GitHub
Langage dominant
Rust
Étoiles
600
Forks
59
Métriques de merge des PR
Aucune PR mergée en 30 j

Description

In some cases, like HTTP downloads (see [`progress_function`](https://docs.rs/curl/0.4.4/curl/easy/struct.Easy.html#method.progress_function) in libcurl for example), you may not know the size of the download until after you have been in touch with the remote server. But you may still want to create the progress bar to show that things are happening. Once the connection is established, and the `Content-Length` header has been received, the total for the progress bar can be set, and progress can be logged.

It'd be great if `pb` offered a way to create a new, "indeterminate" progress bar, and then allow for the total to be set *afterwards*.

Guide de contribution

Aucun guide de contribution indexé pour ce dépôt

Piste de recherche

Look at the progress bar struct and its methods for setting the total. The issue mentions libcurl's progress_function as a reference. Start by examining how the total is currently set at creation and see if there's an internal field that can be updated. Check existing tests for progress bar updates to understand the expected behavior. 'Done' looks like a new method or a mutable setter that allows changing the total after the bar is created, with the bar transitioning from indeterminate to determinate mode.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Évaluation

Stack technique
rust
Domaine
cli, tooling
Type d'issue
Fonctionnalité
Difficulté
3/5
Temps estimé
1-2 jours
Activité
À l'abandon
Clarté
Clairement spécifiée
Accessibilité débutants
45/100

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.