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§
- Stdout
Destination - Marker type for the process standard output stream.
Enums§
- Newline
Behavior - 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.