Releases: sourcefrog/nutmeg
v0.1.4
v0.1.2
Released 2022-07-27
-
API change: Removed
View::new_stderrandView::write_to. Instead, the view can be drawn on stderr or output can be captured using [Options::destination].
This is better aligned with the idea that programs might have a central function that constructs a [Options], as they will probably want to consistently write to either stdout or stderr. -
New: Output can be captured for inspection in tests using [Options::destination], [Destination::Capture], and [View::captured_output].
-
Improved: Nutmeg avoids redrawing if the model renders identical output to what is already displayed, to avoid flicker.
Nutmeg 0.1.1
- API change:
View::messagetakes the message as anAsRef<str>, meaning it may be either a&strorString. This makes the common case where the message is the result offormat!a little easier.
Nutmeg 0.1.0
-
API change: The
Writetype representing the destination is no longer part of the visible public signature ofView, to hide complexity and since it is not helpful to most callers. -
API change: Renamed
View::to_stderrtoView::new_stderr. -
New:
percent_doneandestimate_remainingfunctions to help in rendering progress bars. -
New: The
modelsmod provides some generally-useful basic models, specificallymodels::StringPair,models::UnboundedModelandmodels::LinearModel. These build only on the public interface of Nutmeg, so also constitute examples of what can be done in application-defined models. -
New:
View::finishremoves the progress bar (if painted) and returns theModel.View::abandonnow also returns the model. -
New:
Model::final_messageto let the model render a message to be printed when work is complete. -
New: The callback to
View::updatemay return a value, and this is passed back to the caller ofView::update. -
New:
models::BasicModelallows simple cases to supply both an initial value and a render function inline in theViewconstructor call, avoiding any need to define aModelstruct. -
New:
View::inspect_modelgives its callback a&mutto the model. -
New: Progress bars constructed by
View::newandView::new_stderrare disabled when$TERM=dumb.
Nutmeg 0.0.2
-
API change: Renamed
nutmeg::ViewOptionsto justnutmeg::Options. -
Fixed: A bug that caused leftover text when multi-line bars shrink in width.
-
Fixed: The output from bars created with
View::newandView::to_stderrin Rust tests is captured with the test output rather than leaking through to cargo's output. -
New method
View::messageto print a message to the terminal, as an alternative to usingwrite!(). -
New
example/multithreaded.rsshowing how a View and Model can be shared across threads.
Nutmeg 0.0.1
-
Rate-limit updates to the terminal, controlled by
ViewOptions::update_intervalandViewOptions::print_holdoff. -
Fix a bug where the bar was sometimes not correctly erased by
View::suspend. -
Change to
parking_lotmutexes in the implementation.
Nutmeg 0.0.0
Initial release. Features include:
- The application has complete control of styling, including coloring etc.
- Draw and erase progress bars.
- Write messages "under" the progress bar with
writeln!(view, ...). The bar is automatically suspended and restored. If the message has no final newline, the bar remains suspended until the line is completed.