Crates.io | noline |
lib.rs | noline |
version | 0.5.1 |
source | src |
created_at | 2022-03-14 14:49:28.873046 |
updated_at | 2024-12-12 14:33:22.279068 |
description | A no_std line editor |
homepage | |
repository | https://github.com/rustne-kretser/noline |
max_upload_size | |
id | 549873 |
size | 140,843 |
Noline is an IO-agnostic #[no_std]
line editor providing robust
line editing for any system. The core functionality is IO-free, so
it can be adapted to any system be it embedded, async, async
embedded, WASM or IPoAC (IP over Avian Carriers).
Features:
Possible future features:
The API should be considered experimental and will change in the future.
The core implementation consists of a state machine taking bytes as input and yielding iterators over byte slices. Because this is done without any IO, Noline can be adapted to work on any platform.
Noline comes with multiple implemenations:
sync_editor::Editor
] – Editor for synchronous IOasync_editor::Editor
] - Editor for asynchronous IOEditors can be built using [builder::EditorBuilder
].
let prompt = "> ";
let mut io = MyIO {}; // IO handler, see full examples for details
// how to implement it
let mut editor = EditorBuilder::new_unbounded()
.with_unbounded_history()
.build_sync(&mut io)
.unwrap();
while let Ok(line) = editor.readline(prompt, &mut io) {
writeln!(io, "Read: '{}'", line).unwrap();
}
For more details, see docs.
Add this to your Cargo.toml:
[dependencies]
noline = "0.5.1"
MPL-2.0