package progress

  1. Overview
  2. Docs
User-definable progress bars

Install

Dune Dependency

Authors

Maintainers

Sources

progress-0.4.0.tbz
sha256=8be449553379bb2dc5e8b79805c80447690a03dca3e9aee959fecf46d8278fb7
sha512=841383e8aa7d6bd802ced5eb7feae01bd507b2914eb45e8a559140677f83d5b8ec614f1d0bc54421021b5254a1edd78dd8a2506b2dfb264af72448d76bd03ac5

doc/progress.engine/Progress_engine/Make/Display/index.html

Module Make.DisplaySource

Sourcetype ('a, 'b) t

The type of active progress bar displays. The type parameters 'a and 'b track the types of the reporting functions supplied by reporters (see Multi.t for details).

Sourceval start : ?config:Config.t -> ('a, 'b) Multi.t -> ('a, 'b) t

Initiate rendering of a progress bar display. Raises Failure if there is already an active progress bar display.

Sourceval reporters : ('a, unit) t -> ('a, unit) Reporter.list

reporters d is the list of initial reporting functions belonging to display d.

Note this list does not include any reporters added during progress bar rendering via add_line.

Sourceval tick : (_, _) t -> unit

tick d re-renders the contents of display d without reporting any specific values. This function can be used to update spinners, durations, etc. when there is no actual progress to report.

Sourceval add_line : ?above:int -> (_, _) t -> 'a Line.t -> 'a Reporter.t

Add a line to an ongoing display, and get its reporting function. By default, the line is added to the bottom of the display (above = 0); the ~above argument can be passed to add the line above some number of existing lines.

Sourceval remove_line : (_, _) t -> _ Reporter.t -> unit

Remove a line from an ongoing display, identified by the reporting function that was returned by add_line. Lines may be removed either before they are finalised (for example if some task has been cancelled) or after being finalised. In both cases, the line will be removed from the display, thus retrieving some space in the terminal. Attempting to remove a line that has already been removed from the display will raise Failure. Also raises Failure if the display has already been finalised.

Sourceval pause : (_, _) t -> unit

Suspends the rendering of any active progress bar display. It can be useful to compose with the Logs library and avoid interference when printing to stdout / stderr from the rendering of progress bars.

Sourceval resume : (_, _) t -> unit

Resume the rendering of progress bar display.

Sourceval finalise : (_, _) t -> unit

Terminate the given progress bar display. Raises Failure if the display has already been finalised.

OCaml

Innovation. Community. Security.