Expand description

Run commands in a concurrant manner There are three main components to this API:

  1. Channel-based API: a basic API that passes all messages, errors, and statuses to channels that the caller can consume at their leisure. See ChannelCommand
  2. Standard-out based API: an API that prints messages and errors to the console (standard out). See ConsoleCommand
  3. Writer-based API: similar to the standard-out API but prints to an arbitrary writer (like a log file) instead. See WriterCommand

Structs

This is the lowest-level of the three apis. It returns a channel which allows the caller to process all command output manually. This API provides the most flexibility at the cost of the most work to the user.

A handle so the caller can control various aspects of the running commands

Represents a command that prints all messages to the console. You can set the color of the command via the ConsoleCommand::color function. The default is a random color (Color::Random). In this case, currant will choose random but distinct colors so that all commands are as visually distant as possible.

provides a handle to the running children process for the Writer and Console API. This differs from CommandHandle in that it doesn’t provide any reference to the output channel since that is managed internally by currant.

Provides a way to send signals to the underlying processes.

An Internal class that isn’t really meant to be used externally. If you wish to create other variants of the API (other Command formats). You will need to wrap an internal command and provide accessors to it. See Command for more info

Represents output from a command

A structure that represents a set of commands to run. Essentially, this wraps a list of commands with some common options between them.

Represents a command that prints output to a given Writer. All messages for all commands will be printed to the same writer. If you want different writers for different commands, you will need to manually pipe the output via the channel API. See ChannelCommand for more info. In order to instantiate the Runner with the correct writer, see: Runner::execute

Enums

Represents colors in an ANSI terminal. Represents the color of the text printed to the screen. This is used in the Console API to tell currant what color to print the command metadata. Each command should get a different color to visually differentiate output. A Color can be an RGB value, random, or the terminal’s default color.

Error type describing any errors encountered while constructing the command

Line endings for lines of output to standard out or standard error

The payload of an output message

An enum to tell currant what to do when a process exits with nonzero (AKA failure) status

Types of operating system signals

Constants

Traits

Common trait expressing all the various operations you can do with a Command Includes methods to parse commands and includes various options common to all Commands (Channel/Stdout/Writer) like setting a current directory and setting env vars.

Functions

Type Definitions

Exit status tuple. This string is the human-readable command name, the exit status is the exit status code of the process if available