Skip to main content

Crate use_stdin

Crate use_stdin 

Source
Expand description

§use-stdin

Synchronous stdin primitives for RustUse CLI-adjacent code.

This crate provides small read helpers and marker types. It does not assume an async runtime or interactive UI framework.

§Example

use std::io::Cursor;
use use_stdin::read_to_string_from;

let input = read_to_string_from(Cursor::new("hello"))?;

assert_eq!(input, "hello");

§Scope

Use this crate for testable, synchronous stdin-adjacent helpers.

Modules§

prelude
Commonly used stdin primitives.

Structs§

StdinSource
Marker type for the process standard input stream.

Functions§

read_line_from
Reads one line from a buffered reader.
read_stdin_line
Reads one line from process stdin.
read_stdin_to_string
Reads all process stdin into a string.
read_to_string_from
Reads all content from a generic reader into a string.