Crate minus[−][src]
Expand description
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
Modules
Provides error types that are used in various places
Provides the InputHandler
trait, which can be used
to customize the default keybindings of minus
Structs
A struct containing basic configurations for the pager. This is used by all initializing functions
Enums
Behaviour that happens when the pager is exitted
Enum indicating whether to display the line numbers or not.
search
Defines modes in which the search can run
Functions
async_std_lib
Run the pager inside an async_std task
.
static_output
Outputs static information.
tokio_lib
Run the pager inside a tokio task
.
Type Definitions
A convinience type for Vec<Box<dyn FnMut() + Send + Sync + 'static>>
tokio_lib
or async_std_lib
A convinience tyoe for std::sync::Arc<async_mutex::Mutex<Pager>>