Crate minus[−][src]
A fast, asynchronous terminal paging library for Rust. minus
provides high
level functionalities to easily write a pager for any terminal application.
Due to the asynchronous nature of minus
, the pager’s data can be
updated (this needs the correct feature to be enabled).
minus
supports both tokio
as well as async-std
runtimes. What’s
more, if you only want to use minus
for serving static output, you can
simply opt out of these dynamic features, see the
Features section below.
Why this crate ?
minus
was started by me for my work on pijul
. I was unsatisfied with
the existing options like pager
and moins
.
-
- Only provides functions to join the standard output of the current
program to the standard input of external pager like
more
orless
. - Due to this, to work within Windows, the external pagers need to be packaged along with the executable.
- Only provides functions to join the standard output of the current
program to the standard input of external pager like
-
- The output could only be defined once and for all. It is not asynchronous and does not support updating.
The main goals of minus
are to be very compact and as configurable as possible.
-
minus
provides a lot of configurablity to the end-application and this configuration can be defined not just in compile-time but also in runtime. Your entire configuration like the output displayed, prompt and line numbers are inside aArc<Mutex>
, which means at any time you can lock the configuration, change something, and voila minus will automatically update the screen -
When using
minus
, you select what features you need and nothing else. See Features below
Features
Structs
DefaultInputHandler | The default keybindings in |
Mutex | An async mutex. |
Pager | A struct containing basic configurations for the pager. This is used by all initializing functions |
RegexError | There was an error while compiling the regex |
TermError | An operation on the terminal failed, for example resizing it. |
Enums
AlternateScreenPagingError | Errors that can happen while running |
CleanupError | Errors that can occur during clean up |
ExitStrategy | Behaviour that happens when the pager is exitted |
InputEvent | Events handled by the |
LineNumbers | Enum indicating whether to display the line numbers or not. |
SearchMode | Defines modes in which the search can run |
SetupError | Errors that can occur during setup |
Traits
InputHandler | Define custom keybindings |
Functions
async_std_updating | Run the pager inside an |
page_all | Outputs static information. |
Type Definitions
ExitCallbacks | |
PagerMutex |