libedit-sys 0.2.0

Low-level FFI bindings to the libedit line-editing library
Documentation
  • Coverage
  • 0.52%
    1 out of 192 items documented0 out of 29 items with examples
  • Size
  • Source code size: 35.93 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 1.89 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 3s Average build duration of successful builds.
  • all releases: 3s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • ogital-net/libedit-rs
    0 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • sjthomason

libedit

Safe Rust bindings to the libedit line-editing library (the BSD alternative to GNU readline).

Crates

Crate Description
libedit Safe, ergonomic wrapper with history, completion, hints, and suggestions
libedit-sys Raw FFI bindings generated by bindgen

Example

use libedit::EditLine;

let mut el = EditLine::new("example").unwrap();
if let Some(line) = el.readline("prompt> ").unwrap() {
    println!("got: {line}");
}

A fuller example demonstrating tab completion, history, inline suggestions, and hints is available in libedit/examples/repl.rs:

cargo run --example repl

System dependencies

The libedit development headers and library are required at build time.

Platform Command
Debian/Ubuntu apt install libedit-dev
Fedora/RHEL dnf install libedit-devel
macOS (Homebrew) brew install libedit
Arch Linux pacman -S libedit

To regenerate bindings with the bindgen feature, also install libclang-dev (or equivalent).

MSRV

The minimum supported Rust version is 1.82.

License

Licensed under the BSD 2-Clause License (LICENSE).