{"id":26009778,"url":"https://github.com/nullx76/ringbuffer","last_synced_at":"2025-05-15T15:03:37.101Z","repository":{"id":41952940,"uuid":"271589233","full_name":"NULLx76/ringbuffer","owner":"NULLx76","description":"A fixed-size circular buffer written in Rust.","archived":false,"fork":false,"pushed_at":"2024-10-31T09:53:04.000Z","size":480,"stargazers_count":113,"open_issues_count":20,"forks_count":23,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-27T03:10:26.196Z","etag":null,"topics":["circular-buffer","hacktoberfest","no-std","ringbuffer","rust"],"latest_commit_sha":null,"homepage":"https://crates.io/crates/ringbuffer","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/NULLx76.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,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-06-11T16:01:31.000Z","updated_at":"2025-03-26T15:11:41.000Z","dependencies_parsed_at":"2024-05-16T06:11:59.372Z","dependency_job_id":"13f156a9-bd59-42d8-8635-ca5e52d49279","html_url":"https://github.com/NULLx76/ringbuffer","commit_stats":{"total_commits":244,"total_committers":12,"mean_commits":"20.333333333333332","dds":0.5081967213114754,"last_synced_commit":"75fe4f1b0bd9629ad45490363b53110d3c9edaec"},"previous_names":[],"tags_count":20,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NULLx76%2Fringbuffer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NULLx76%2Fringbuffer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NULLx76%2Fringbuffer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NULLx76%2Fringbuffer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/NULLx76","download_url":"https://codeload.github.com/NULLx76/ringbuffer/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246933382,"owners_count":20857055,"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":["circular-buffer","hacktoberfest","no-std","ringbuffer","rust"],"created_at":"2025-03-05T22:04:25.576Z","updated_at":"2025-04-03T04:12:23.700Z","avatar_url":"https://github.com/NULLx76.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Ringbuffer\n![Github Workflows](https://img.shields.io/github/actions/workflow/status/NULLx76/ringbuffer/rust.yml?style=for-the-badge)\n[![Docs.rs](https://img.shields.io/badge/docs.rs-ringbuffer-66c2a5?style=for-the-badge\u0026labelColor=555555\u0026logoColor=white\u0026logo=data:image/svg+xml;base64,PHN2ZyByb2xlPSJpbWciIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgdmlld0JveD0iMCAwIDUxMiA1MTIiPjxwYXRoIGZpbGw9IiNmNWY1ZjUiIGQ9Ik00ODguNiAyNTAuMkwzOTIgMjE0VjEwNS41YzAtMTUtOS4zLTI4LjQtMjMuNC0zMy43bC0xMDAtMzcuNWMtOC4xLTMuMS0xNy4xLTMuMS0yNS4zIDBsLTEwMCAzNy41Yy0xNC4xIDUuMy0yMy40IDE4LjctMjMuNCAzMy43VjIxNGwtOTYuNiAzNi4yQzkuMyAyNTUuNSAwIDI2OC45IDAgMjgzLjlWMzk0YzAgMTMuNiA3LjcgMjYuMSAxOS45IDMyLjJsMTAwIDUwYzEwLjEgNS4xIDIyLjEgNS4xIDMyLjIgMGwxMDMuOS01MiAxMDMuOSA1MmMxMC4xIDUuMSAyMi4xIDUuMSAzMi4yIDBsMTAwLTUwYzEyLjItNi4xIDE5LjktMTguNiAxOS45LTMyLjJWMjgzLjljMC0xNS05LjMtMjguNC0yMy40LTMzLjd6TTM1OCAyMTQuOGwtODUgMzEuOXYtNjguMmw4NS0zN3Y3My4zek0xNTQgMTA0LjFsMTAyLTM4LjIgMTAyIDM4LjJ2LjZsLTEwMiA0MS40LTEwMi00MS40di0uNnptODQgMjkxLjFsLTg1IDQyLjV2LTc5LjFsODUtMzguOHY3NS40em0wLTExMmwtMTAyIDQxLjQtMTAyLTQxLjR2LS42bDEwMi0zOC4yIDEwMiAzOC4ydi42em0yNDAgMTEybC04NSA0Mi41di03OS4xbDg1LTM4Ljh2NzUuNHptMC0xMTJsLTEwMiA0MS40LTEwMi00MS40di0uNmwxMDItMzguMiAxMDIgMzguMnYuNnoiPjwvcGF0aD48L3N2Zz4K)](https://docs.rs/ringbuffer)\n[![Crates.io](https://img.shields.io/crates/v/ringbuffer?logo=rust\u0026style=for-the-badge)](https://crates.io/crates/ringbuffer)\n\nThe ringbuffer crate provides safe fixed size circular buffers (ringbuffers) in rust.\n\nImplementations for three kinds of ringbuffers, with a mostly similar API are provided:\n\n| type                           | description                                                                                                                                                            |\n|--------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| [`AllocRingBuffer`][1]         | Ringbuffer allocated on the heap at runtime. This ringbuffer is still fixed size. This requires the alloc feature.                                                     |\n| [`GrowableAllocRingBuffer`][2] | Ringbuffer allocated on the heap at runtime. This ringbuffer can grow in size, and is implemented as an `alloc::VecDeque` internally. This requires the alloc feature. |\n| [`ConstGenericRingBuffer`][3]  | Ringbuffer which uses const generics to allocate on the stack.                                                                                                         |\n\nAll of these ringbuffers also implement the [RingBuffer][4] trait for their shared API surface.\n\n[1]: https://docs.rs/ringbuffer/latest/ringbuffer/struct.AllocRingBuffer.html\n[2]: https://docs.rs/ringbuffer/latest/ringbuffer/struct.GrowableAllocRingBuffer.html\n[3]: https://docs.rs/ringbuffer/latest/ringbuffer/struct.ConstGenericRingBuffer.html\n[4]: https://docs.rs/ringbuffer/latest/ringbuffer/trait.RingBuffer.html\n\nMSRV: Rust 1.59\n\n# Usage\n\n```rust\nuse ringbuffer::{AllocRingBuffer, RingBuffer};\n\nlet mut buffer = AllocRingBuffer::with_capacity(2);\n\n// First entry of the buffer is now 5.\nbuffer.push(5);\n\n// The last item we pushed is 5\nassert_eq!(buffer.back(), Some(\u00265));\n\n// Second entry is now 42.\nbuffer.push(42);\nassert_eq!(buffer.peek(), Some(\u00265));\nassert!(buffer.is_full());\n\n// Because capacity is reached the next push will be the first item of the buffer.\nbuffer.push(1);\nassert_eq!(buffer.to_vec(), vec![42, 1]);\n```\n\n# Features\n\n| name  | default | description                                                                                                  |\n|-------|---------|--------------------------------------------------------------------------------------------------------------|\n| alloc | ✓       | Disable this feature to remove the dependency on alloc. Disabling this feature  makes `ringbuffer` `no_std`. |\n\n# License\n\nLicensed under MIT License\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnullx76%2Fringbuffer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnullx76%2Fringbuffer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnullx76%2Fringbuffer/lists"}