Skip to main content

Crate micromux

Crate micromux 

Source
Expand description

micromux is a small process supervisor with a terminal UI.

The crate provides the core scheduling and service-management logic used by the CLI and TUI. Most users will interact with it through Micromux and configuration parsing via from_str.

§Examples

Parse a configuration file and construct a Micromux instance:

let raw = std::fs::read_to_string("./micromux.yaml")?;
let config_dir = std::path::Path::new(".");
let file_id = 0usize;
let mut diagnostics = vec![];
let config = micromux::from_str(&raw, config_dir, file_id, None, &mut diagnostics)?;
let mux = micromux::Micromux::new(&config)?;

Structs§

AsyncBoundedLog
An async wrapper around BoundedLog that supports subscriptions.
BoundedLog
A log buffer that retains only the most recent entries, bounded by line count and/or total bytes.
CancellationToken
A token which can be used to signal a cancellation request to one or more tasks.
ConfigFile
A parsed config file together with its origin metadata.
Micromux
Main entry point to run a micromux session.
Printer
A diagnostics printer backed by codespan_reporting.
ServiceDescriptor
A simplified view of a service for presentation (e.g. in a UI).

Enums§

Command
A command sent to the scheduler.
ConfigError
Errors that can occur while parsing configuration.
Event
A scheduler event.
LogUpdateKind
The kind of log update.
OutputStream
Origin stream of output.

Traits§

ToDiagnostics
Convert an error type into codespan diagnostics.

Functions§

find_config_file
Find a configuration file in the given directory.
from_str
Parse a micromux configuration from a YAML string.
project_dir
Return the OS-specific project directories for micromux.

Type Aliases§

ServiceID
Unique identifier for a service.