{"id":13438701,"url":"https://github.com/gchp/rustbox","last_synced_at":"2025-05-16T00:00:25.389Z","repository":{"id":18730454,"uuid":"21941844","full_name":"gchp/rustbox","owner":"gchp","description":"Rust implementation of the termbox library","archived":false,"fork":false,"pushed_at":"2020-10-10T15:35:36.000Z","size":180,"stargazers_count":470,"open_issues_count":23,"forks_count":47,"subscribers_count":20,"default_branch":"master","last_synced_at":"2025-05-08T11:50:01.964Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/gchp.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-07-17T12:55:21.000Z","updated_at":"2025-05-02T00:29:48.000Z","dependencies_parsed_at":"2022-07-13T11:10:30.471Z","dependency_job_id":null,"html_url":"https://github.com/gchp/rustbox","commit_stats":null,"previous_names":[],"tags_count":36,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gchp%2Frustbox","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gchp%2Frustbox/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gchp%2Frustbox/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gchp%2Frustbox/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gchp","download_url":"https://codeload.github.com/gchp/rustbox/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254442854,"owners_count":22071877,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-07-31T03:01:07.681Z","updated_at":"2025-05-16T00:00:25.013Z","avatar_url":"https://github.com/gchp.png","language":"Rust","funding_links":[],"categories":["Libraries","代码","库 Libraries","Rust","库"],"sub_categories":["Command-line","GUI","命令行 Command-line","命令行"],"readme":"# Rustbox\n\nRustbox is a Rust implementation of [termbox](http://github.com/nsf/termbox).\n\nCurrently, this is just a wrapper of the C library by nsf, though my plan is to convert it to be a pure Rust implementation and remove the requirement on the C library.\n\nThe original implementation of this was inspired by [Aaron Pribadi](http://github.com/apribadi/rust-termbox), so big props to him for the original work.\n\n**NOTE** This is under development, and the APIs may change as I figure out more how Rust works and as the language itself changes\n\n[**Documentation**](https://docs.rs/rustbox/)\n\n\n## Usage\n\nIn your `Cargo.toml` add the following:\n\n```toml\n[dependencies]\nrustbox = \"*\"\n```\n\nYou can also use the current git version by instead adding:\n\n```toml\n[dependencies.rustbox]\ngit = \"https://github.com/gchp/rustbox.git\"\n```\n\nThen, in your `src/example.rs`:\n\n```rust\nextern crate rustbox;\n\nuse std::error::Error;\nuse std::default::Default;\n\nuse rustbox::{Color, RustBox};\nuse rustbox::Key;\n\nfn main() {\n    let rustbox = match RustBox::init(Default::default()) {\n        Result::Ok(v) =\u003e v,\n        Result::Err(e) =\u003e panic!(\"{}\", e),\n    };\n\n    rustbox.print(1, 1, rustbox::RB_BOLD, Color::White, Color::Black, \"Hello, world!\");\n    rustbox.print(1, 3, rustbox::RB_BOLD, Color::White, Color::Black,\n                  \"Press 'q' to quit.\");\n    rustbox.present();\n    loop {\n        match rustbox.poll_event(false) {\n            Ok(rustbox::Event::KeyEvent(key)) =\u003e {\n                match key {\n                    Key::Char('q') =\u003e { break; }\n                    _ =\u003e { }\n                }\n            },\n            Err(e) =\u003e panic!(\"{}\", e.description()),\n            _ =\u003e { }\n        }\n    }\n}\n```\n\n**NOTE:** this example can also be run with `cargo run --example hello-world`.\n\n### Projects that use this crate:\n\n* [hostblock](https://github.com/cgag/hostblock)\n* [rust-2048](https://github.com/kdar/rust-2048)\n* [marching-squares](https://github.com/crespyl/marching-squares)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgchp%2Frustbox","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgchp%2Frustbox","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgchp%2Frustbox/lists"}