termpulse-core 0.1.0

Core OSC 9;4 terminal progress protocol — build, parse, and sanitize escape sequences. No-std compatible, zero dependencies.
docs.rs failed to build termpulse-core-0.1.0
Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.

termpulse-core

Crates.io docs.rs License

Core OSC 9;4 terminal progress protocol -- build, parse, and sanitize escape sequences.

no_std compatible, zero dependencies, zero allocations.

Usage

use termpulse_core::{OscSequence, ProgressState, Terminator};

// Build a sequence
let seq = OscSequence::normal_with_label(50, "Building");
let mut buf = [0u8; 256];
let n = seq.write_to(&mut buf).unwrap();
// buf[..n] = b"\x1b]9;4;1;50;Building\x1b\\"

// Parse sequences from raw bytes
use termpulse_core::{ParsedSequence, find_sequences};
let mut out = [ParsedSequence::EMPTY; 8];
let count = find_sequences(&buf[..n], &mut out);
assert_eq!(count, 1);

// Sanitize labels (prevent escape injection)
use termpulse_core::sanitize_label;
let clean = sanitize_label("evil\x1b]inject");
assert_eq!(clean, "evil");

Feature flags

Feature Default Description
std off Implements std::error::Error for WriteError

Part of termpulse

This is the low-level core crate. For the full library with terminal detection, backends, throttling, and ETA estimation, see termpulse. For the CLI, see termpulse-cli.

License

MIT