Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mdsn/ascii-read
Methods to read AsciiString from BufReader instances.
https://github.com/mdsn/ascii-read
rust
Last synced: about 2 months ago
JSON representation
Methods to read AsciiString from BufReader instances.
- Host: GitHub
- URL: https://github.com/mdsn/ascii-read
- Owner: mdsn
- License: mit
- Created: 2022-12-06T02:37:44.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2022-12-06T02:51:58.000Z (about 2 years ago)
- Last Synced: 2024-10-31T11:45:14.862Z (3 months ago)
- Topics: rust
- Language: Rust
- Homepage:
- Size: 3.91 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
ascii-read
==========This library provides a trait with `read_ascii_lines()` and `read_ascii_line()` methods, parallel to those of [`BufRead`], that return [`ascii::AsciiString`].
[`ascii::AsciiString`]: https://docs.rs/ascii/latest/ascii/struct.AsciiString.html
[`BufRead`]: https://doc.rust-lang.org/std/io/trait.BufRead.html```toml
[dependencies]
ascii-read = "0.1.0"
```#### Example
Run this example with `cargo run --example ascii_lines`.
```rust
use ascii_read::AsciiBufRead;
use std::error::Error;
use std::io;fn main() -> Result<(), Box> {
let handle = io::stdin().lock();
let mut lines = vec![];for line in handle.ascii_lines() {
lines.push(line?);
}println!("* Input provided:");
for line in lines {
println!("{line}");
}
Ok(())
}
```#### Dependencies
This library depends on the [`ascii`] and [`thiserror`] crates.
[`ascii`]: https://docs.rs/ascii/latest/ascii/
[`thiserror`]: https://docs.rs/thiserror/latest/thiserror/#### License
Licensed under MIT license.