{"id":13439001,"url":"https://github.com/skade/leveldb","last_synced_at":"2025-04-09T05:04:30.398Z","repository":{"id":15287340,"uuid":"18016863","full_name":"skade/leveldb","owner":"skade","description":null,"archived":false,"fork":false,"pushed_at":"2022-06-22T11:05:44.000Z","size":1032,"stargazers_count":182,"open_issues_count":18,"forks_count":53,"subscribers_count":10,"default_branch":"master","last_synced_at":"2025-04-01T20:25:13.994Z","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/skade.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-03-22T18:40:04.000Z","updated_at":"2025-01-08T15:04:51.000Z","dependencies_parsed_at":"2022-07-20T21:32:14.031Z","dependency_job_id":null,"html_url":"https://github.com/skade/leveldb","commit_stats":null,"previous_names":[],"tags_count":23,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/skade%2Fleveldb","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/skade%2Fleveldb/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/skade%2Fleveldb/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/skade%2Fleveldb/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/skade","download_url":"https://codeload.github.com/skade/leveldb/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247980808,"owners_count":21027803,"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:10.342Z","updated_at":"2025-04-09T05:04:30.377Z","avatar_url":"https://github.com/skade.png","language":"Rust","readme":"# Rust leveldb bindings\n\nAlmost-complete bindings for leveldb for Rust.\n\n[Documentation](https://docs.rs/leveldb/0.8.4/leveldb/)\n\n## Rust version policy\n\n`leveldb` is built and tested on stable releases of Rust. This are currently `1.31.0` and `1.43.1`. Nightlies\nmight not build at any point and failures are allowed. There are no known issues with nightlies, though.\n\n## Prerequisites\n\n`snappy` and `leveldb` need to be installed. On Ubuntu, I recommend:\n\n```sh\nsudo apt-get install libleveldb-dev libsnappy-dev\n```\n\n## Usage\n\nIf your project is using [Cargo](http://crates.io), drop the following lines in your `Cargo.toml`:\n\n```text\n[dependencies]\n\nleveldb = \"0.8\"\n```\n\n## Development\n\nMake sure you have all prerequisites installed. Run\n\n```sh\n$ cargo build\n```\n\nfor building and\n\n```sh\n$ cargo test\n```\n\nto run the test suite.\n\n## Examples\n\n```rust\nextern crate tempdir;\nextern crate leveldb;\n\nuse tempdir::TempDir;\nuse leveldb::database::Database;\nuse leveldb::iterator::Iterable;\nuse leveldb::kv::KV;\nuse leveldb::options::{Options,WriteOptions,ReadOptions};\n\nfn main() {\n  let tempdir = TempDir::new(\"demo\").unwrap();\n  let path = tempdir.path();\n\n  let mut options = Options::new();\n  options.create_if_missing = true;\n  let mut database = match Database::open(path, options) {\n      Ok(db) =\u003e { db },\n      Err(e) =\u003e { panic!(\"failed to open database: {:?}\", e) }\n  };\n\n  let write_opts = WriteOptions::new();\n  match database.put(write_opts, 1, \u0026[1]) {\n      Ok(_) =\u003e { () },\n      Err(e) =\u003e { panic!(\"failed to write to database: {:?}\", e) }\n  };\n\n  let read_opts = ReadOptions::new();\n  let res = database.get(read_opts, 1);\n\n  match res {\n    Ok(data) =\u003e {\n      assert!(data.is_some());\n      assert_eq!(data, Some(vec![1]));\n    }\n    Err(e) =\u003e { panic!(\"failed reading data: {:?}\", e) }\n  }\n\n  let read_opts = ReadOptions::new();\n  let mut iter = database.iter(read_opts);\n  let entry = iter.next();\n  assert_eq!(\n    entry,\n    Some((1, vec![1]))\n  );\n}\n```\n\n## Open issues\n\n* Filter policies are missing\n* Iterators with arbirary start and end points are unsupported\n\n# License\n\nMIT, see `LICENSE`\n","funding_links":[],"categories":["Libraries","库 Libraries","库"],"sub_categories":["Database","数据库 Database","数据库"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fskade%2Fleveldb","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fskade%2Fleveldb","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fskade%2Fleveldb/lists"}