Skip to main content

Crate cuno_core

Crate cuno_core 

Source
Expand description

What the other cuno crates share: error classification, output, the cuno home, the environment snapshot, and path identity. Nothing else belongs here without a change to the spec.

See docs/en/specs/architecture.md, “What goes in cuno-core”.

Modules§

paths
Whether two paths are the same place, or one lies inside the other: the one answer every crate asks (docs/en/specs/project-layout.md, “Source collection and linking”; docs/en/specs/architecture.md, “What goes in cuno-core”). Only comparing uses where a path leads; the path a caller goes on to use or show stays as written.
program
Starting a program cuno built: what cuno run and the test runner both decide the same way (docs/en/specs/architecture.md, “What goes in cuno-core”). How its standard streams are handled is the caller’s: cuno run leaves them connected, the test runner captures them.

Structs§

Env
Environment variables, looked up by name.
Shell
Where cuno’s messages go (stderr for the binary). Crates write through a Shell instead of printing, so the color decision is made once.

Enums§

ColorChoice
A color choice given with --color or [term] color (docs/en/specs/commands.md).
ExitClass
The kind of failure, which decides the exit code. Every error a crate returns says which kind it is, so the binary never has to know the crate’s error types to choose an exit code.
HomeError
Why there is no cuno home.
NameCase
How names are compared, variables’ and files’ alike, which depends on the operating system they came from.
Verbosity
How much a command shows: -q, nothing given, or -v (or [term] verbose, which -q still wins over). One value, so quiet and verbose cannot both be in effect (docs/en/specs/commands.md, “Available for all commands”).

Traits§

CunoError
An error any cuno crate can return to cuno-cli, which reports it in one place, error: <Display> then help: <help> when there is one, and returns ExitClass::code for the binary to exit with (crates/cuno-cli/src/lib.rs, report).

Functions§

colors
Whether to color: --color (given), then [term] color (configured), then NO_COLOR (no_color, set to anything, even empty), then whether the output is a terminal. The one place this order is written; see docs/en/specs/commands.md, “Available for all commands”.
cuno_home
The cuno home: CUNO_HOME when set and not empty, which must be absolute, else .cuno under USERPROFILE, else under HOME.