{"id":16956192,"url":"https://github.com/novara754/circbuf-rs","last_synced_at":"2025-08-19T08:34:39.527Z","repository":{"id":106797172,"uuid":"364267562","full_name":"novara754/circbuf-rs","owner":"novara754","description":"Basic circular buffer library for Rust.","archived":false,"fork":false,"pushed_at":"2022-05-22T12:56:17.000Z","size":10,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-21T12:58:51.590Z","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/novara754.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,"governance":null}},"created_at":"2021-05-04T13:35:58.000Z","updated_at":"2022-05-22T12:46:58.000Z","dependencies_parsed_at":"2023-07-27T17:59:45.716Z","dependency_job_id":null,"html_url":"https://github.com/novara754/circbuf-rs","commit_stats":null,"previous_names":["emilycrab/circbuf-rs","novara754/circbuf-rs"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/novara754/circbuf-rs","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/novara754%2Fcircbuf-rs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/novara754%2Fcircbuf-rs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/novara754%2Fcircbuf-rs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/novara754%2Fcircbuf-rs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/novara754","download_url":"https://codeload.github.com/novara754/circbuf-rs/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/novara754%2Fcircbuf-rs/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":271122111,"owners_count":24702948,"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","status":"online","status_checked_at":"2025-08-19T02:00:09.176Z","response_time":63,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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-10-13T22:14:26.029Z","updated_at":"2025-08-19T08:34:39.495Z","avatar_url":"https://github.com/novara754.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![CI](https://github.com/vzwGrey/circbuf-rs/actions/workflows/ci.yaml/badge.svg)](https://github.com/vzwGrey/circbuf-rs/actions/workflows/ci.yaml)\n\n# circbuf\n\nBasic [circular buffer](https://en.wikipedia.org/wiki/Circular_buffer) library for Rust.\n\n## Example\n\n```rust\nuse circbuf::CircBuf;\n\nfn main() {\n    // Create a new circular buffer that can hold 16 elements\n    let mut buf = CircBuf::\u003ci32, 16\u003e::new();\n    // Fill the buffer completely\n    for i in 0..16 {\n        buf.push(i);\n    }\n    assert!(buf.is_full());\n\n    // Iterate over values\n    for n in buf.iter() {\n        println!(\"{}\", n);\n    }\n\n    // Adding values when the buffer is full overwrites the oldest value\n    for i in 16..19 {\n        buf.push(i);\n    }\n\n    // Iterate over values again\n    for n in buf.iter() {\n        println!(\"{}\", n);\n    }\n\n    // Index specific values\n    println!(\"buf[0] = {}\", buf[0]);\n    // println!(\"buf[20] = {}\", buf[20]); // panic when index invalid\n\n    // Delete values while the buffer is not empty\n    while !buf.is_empty() {\n        // Popped values are returned in Option\n        println!(\"{}\", buf.pop().unwrap());\n    }\n\n    // Check number of elements in a buffer\n    assert_eq!(buf.len(), 0);\n}\n```\n\n## License\n\nLicensed under the [MIT License](./LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnovara754%2Fcircbuf-rs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnovara754%2Fcircbuf-rs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnovara754%2Fcircbuf-rs/lists"}