package progress
Install
Dune Dependency
Authors
Maintainers
Sources
sha256=3dfd00bd4def773239159b17781d02fdbfd8ea191801681a94aa0a5be1d06b7c
sha512=fd64ff8a819b2db2460c06b7fbd5663e2a1941f9e2d4e9b921a3d5f24509fe3be543521fbe1bb6baedad9f62b579aae933efac3903db03a27385233f5461f09c
doc/progress.engine/Progress_engine/Make/Line/Internals/index.html
Module Line.Internals
Source
Exposes the underlying implementation of line segments for testing. This API is unstable, unsafe and mostly undocumented; here be dragons etc.
The type of segments of progress bars that display reported values of type 'a
.
type theta := Progress_engine__.Line_buffer.t -> event -> unit
type 'a alpha := Progress_engine__.Line_buffer.t -> event -> 'a -> unit
of_pp ~width pp
is a segment that uses the supplied fixed-width pretty-printer to render the value. The pretty-printer must never emit newline characters.
conditional pred s
has the same output format as s
, but is only passes reported values down to s
when they satisfy pred
.
Stateful segments
periodic n s
has the same output format as s
, but only passes reported values down to s
on every n
-th call. This is useful when progress is being reported from a hot-loop, where the cost of rendering is non-negligible.
accumulator combine zero s
has the same output format s
.
stateful f
is a segment that behaves as f ()
for any given render, allowing f
to initialise any display state at the start of the rendering process.
Dynamically-sized segments
Certain segments can have their size determined dynamically by being wrapped inside one of the following boxes:
box w
is a box that wraps a dynamically-sized segment and sets it to have size w ()
on each tick.
box-fixed n s
fixes the size of the dynamic segment s
to be n
.
A box that takes on the current size of the terminal (or fallback
if stdout is not attached to a terminal).