Use libbitflags-1.3.2

This updates Android.bp to still use the old version of libbitflags instead
of the most recent version. Also add a patch file for Android.bp which
ensures version 1.3.2 is still used after an update.

Test: Build
Change-Id: Idbd10a9f755018f01c89ba06d1c8137bfdd5a3e2
Merged-In: Iaf360adf2c87e920604f7cfc6658898ba00661d3
2 files changed
tree: dfcc00c957fa1c2786ecc9860f1d7560954238da
  1. benches/
  2. examples/
  3. patches/
  4. src/
  5. tests/
  6. .cargo_vcs_info.json
  7. Android.bp
  8. Cargo.lock
  9. Cargo.toml
  10. Cargo.toml.orig
  11. cargo2android.json
  12. LICENSE-APACHE
  13. LICENSE-MIT
  14. METADATA
  15. MODULE_LICENSE_APACHE2
  16. OWNERS
  17. README.md
README.md

Stable Status Beta Status Nightly Status crates.io docs.rs MIT Apache 2.0 LOC

ANSI Escape Sequences provider & parser

A Rust library which provides an ANSI escape sequences (or codes, whatever you like more) and a parser allowing you to parse data from the STDIN (or /dev/tty) in the raw mode.

Sequences provider

Terminal support

Not all ANSI escape sequences are supported by all terminals. You can use the interactive-test to test them. Checkout the repository and then:

$ cd anes-rs
$ cargo run --bin interactive-test

Examples

[dependencies]
anes = "0.1"

An example how to retrieve the ANSI escape sequence as a String:

use anes::SaveCursorPosition;

fn main() {
    let string = format!("{}", SaveCursorPosition);
    assert_eq!(&string, "\x1B7");
}

An example how to use the ANSI escape sequence:

use std::io::{Result, Write};

use anes::execute;

fn main() -> Result<()> {
    let mut stdout = std::io::stdout();
    execute!(
        &mut stdout,
        anes::SaveCursorPosition,
        anes::MoveCursorTo(10, 10),
        anes::RestoreCursorPosition
    )?;
    Ok(())
}

Sequences parser

You have to enable parser feature in order to use the parser. It's disabled by default.

Examples

[dependencies]
anes = { version = "0.1", features = ["parser"] }

An example how to parse cursor position:

use anes::parser::{Parser, Sequence};

let mut parser = Parser::default();
parser.advance(b"\x1B[20;10R", false);

assert_eq!(Some(Sequence::CursorPosition(10, 20)), parser.next());
assert!(parser.next().is_none());

License

The ANES crate is dual-licensed under Apache 2.0 and MIT terms.

Copyrights in the ANES project are retained by their contributors. No copyright assignment is required to contribute to the ANES project.