tools capa

tools-mem-guard

Runs a command inside a memory-capped systemd-run --user scope, so a runaway process (cargo-mutants, trunk, rclone, ...) gets OOM-killed inside its own cgroup instead of the kernel OOM killer cascading into session.slice and killing ssh/gnome-keyring (the 'account got logged out' failure).

Runs a command inside a memory-capped systemd-run --user scope, so a runaway process (cargo-mutants, trunk, rclone, ...) gets OOM-killed inside its own cgroup instead of the kernel OOM killer cascading into session.slice and killing ssh/gnome-keyring (the 'account got logged out' failure).

Tiertools
Roleunclassified (baselined)
Pathcrates/tools/mem-guard
Edition2021
Targetstools-mem-guard, tools_mem_guard
Public items2 across 0 modules
Tests5

What it is for

Pure argument-building and validation for tools-mem-guard. No process spawning here so the decidable logic is unit-testable without systemd-run present (Gate 2.1 / PROCESS SS5).

Capabilities

crate root

Pure argument-building and validation for tools-mem-guard. No process spawning

Item
fn validate_mem_limit(s : & str) -> Result <(), String>
fn build_scope_argv(max_mem : & str, max_swap : & str, cmd : & String,) -> Result <Vec <String>, String>

How to use it

No examples/ target and no doctest in this crate's rustdoc. The tests listed under Verification are the closest executable usage.

Module structure

No public modules: the crate root is its whole surface.

Public surface

`crate root`

ItemWhat it is
fn validate_mem_limit(s : & str) -> Result <(), String>systemd unit MemoryMax=/MemorySwapMax= accept a byte count with an optional K/M/G/T suffix, or the literal infinity
fn build_scope_argv(max_mem : & str, max_swap : & str, cmd : & String,) -> Result <Vec <String>, String>Builds the argv for systemd-run that runs cmd in a transient --user --scope unit capped at max_mem/max_swap

No pub use re-exports: every item above is declared in this crate.

Boundary

Depends on no other workspace tier.

Shares tier tools with 84 other crates: tools-advisory-reach, tools-archive-guard, tools-artifact-scaffold, tools-ask-ai-core, tools-ask-ais, tools-ask-gemini, tools-book, tools-book-report, … (84 total).

_What this crate deliberately does NOT own is a judgment. No committed registry records one for it, so none is stated here._

Where it sits

Tier (ontology)tools
Architectural role (taxonomy)unclassified (baselined)
Locationcrates/tools/mem-guard
Vocabulary in force (lexicon)current

Dependencies

Runtime, from outside the workspace.

CrateRequirementFeaturesOptionalOnly on
anyhow^1noalways

Development. None.

Build. None.

Depended on by. Nothing in this workspace.

Feature flags

No Cargo features are defined: every capability is unconditional, so no consumer can receive a half-wired crate.

Targets

KindNameSource
bintools-mem-guard`src/main.rs`
libtools_mem_guard`src/lib.rs`

Error model

No public error type was detected: no public item declares a type named *Error, and no public signature returns one.

Operational characteristics

PropertyEvidence
async public surfacenone detected
async runtimenone detected
database accessnone detected
network I/Onone detected
unsafe codenone detected
environment variablesnone detected

No unsafe block, unsafe fn, unsafe impl or unsafe trait was found by the parser anywhere in this crate's source.

Configuration

No environment variable is read with a literal name anywhere in this crate. A variable whose key is computed at run time cannot be listed here, and is not claimed to be absent.

No workspace crate depends on this one.

Verification

KindCount
Unit tests5
Integration tests0
Examples0
Doctests0

Evidence by module. How often each public module is named by something executable.

ModuleTestsExamplesConsumers
crate root200

What the tests establish, by name:

Documentation coverage

MeasureDocumentedTotal
Public items with rustdoc22
Public modules with a //! block00
pie showData
    title Public items with rustdoc
    "Documented" : 2
    "No rustdoc detected" : 0

Metrics

MetricValue
Rust source files2
Source lines188
Code lines154
Public API items2
Public modules0
Tests5
Examples0
Cargo features0
Direct runtime dependencies1
Workspace reverse dependencies0
pie showData
    title Public API by kind
    "function" : 2
pie showData
    title Rust source composition
    "Code" : 154
    "Blank or comment" : 34

Generation

Rendered by tools-corpus corpus readme from repository evidence alone, renderer schema 2, lexicon current. No model, network service or database was consulted. Regenerate with tools-corpus corpus readme --write; verify with --check.

Todas las tools · Manual