Skip to main content

Crate use_stdout

Crate use_stdout 

Source
Expand description

§use-stdout

Synchronous stdout primitives for RustUse CLI-adjacent code.

This crate provides output destination markers, newline behavior helpers, and small write helpers. It does not provide a formatting framework.

§Example

use use_stdout::{NewlineBehavior, apply_newline_behavior, write_text};

let output = apply_newline_behavior("ready", NewlineBehavior::EnsureTrailingNewline);
let mut buffer = Vec::new();
write_text(&mut buffer, &output)?;

assert_eq!(buffer, b"ready\n");

§Scope

Use this crate for small output primitives, not application rendering policy.

Modules§

prelude
Commonly used stdout primitives.

Structs§

StdoutDestination
Marker type for the process standard output stream.

Enums§

NewlineBehavior
Primitive newline policy for text output.

Functions§

apply_newline_behavior
Applies a newline behavior to text and returns an owned string.
write_line
Writes text plus one newline to a generic writer.
write_stdout
Writes text to process stdout.
write_stdout_line
Writes text plus one newline to process stdout.
write_text
Writes text to a generic writer.