{"id":22993881,"url":"https://github.com/erizocosmico/ring_queue","last_synced_at":"2026-02-16T04:31:05.686Z","repository":{"id":57660949,"uuid":"161091834","full_name":"erizocosmico/ring_queue","owner":"erizocosmico","description":"Double-ended queue implementation for Rust.","archived":false,"fork":false,"pushed_at":"2018-12-24T15:38:47.000Z","size":24,"stargazers_count":2,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-24T23:42:03.583Z","etag":null,"topics":["circular","data-structure","deque","queue","ring","rust"],"latest_commit_sha":null,"homepage":"https://docs.rs/ring_queue","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/erizocosmico.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":"2018-12-09T23:37:58.000Z","updated_at":"2025-08-30T20:09:22.000Z","dependencies_parsed_at":"2022-09-06T23:21:26.154Z","dependency_job_id":null,"html_url":"https://github.com/erizocosmico/ring_queue","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/erizocosmico/ring_queue","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/erizocosmico%2Fring_queue","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/erizocosmico%2Fring_queue/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/erizocosmico%2Fring_queue/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/erizocosmico%2Fring_queue/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/erizocosmico","download_url":"https://codeload.github.com/erizocosmico/ring_queue/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/erizocosmico%2Fring_queue/sbom","scorecard":{"id":381399,"data":{"date":"2025-08-11","repo":{"name":"github.com/erizocosmico/ring_queue","commit":"2c6ec68a20c9063c03ddd2838b56f64dcee3dbc8"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3,"checks":[{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Code-Review","score":0,"reason":"Found 0/13 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 8 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-18T15:32:07.200Z","repository_id":57660949,"created_at":"2025-08-18T15:32:07.201Z","updated_at":"2025-08-18T15:32:07.201Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29500300,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-16T03:57:51.541Z","status":"ssl_error","status_checked_at":"2026-02-16T03:55:59.854Z","response_time":115,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["circular","data-structure","deque","queue","ring","rust"],"created_at":"2024-12-15T05:15:28.395Z","updated_at":"2026-02-16T04:31:05.667Z","avatar_url":"https://github.com/erizocosmico.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ring_queue [![Build Status](https://travis-ci.org/erizocosmico/ring_queue.svg?branch=master)](https://travis-ci.org/erizocosmico/ring_queue) [![Documentation](https://docs.rs/ring_queue/badge.svg)](https://docs.rs/ring_queue) [![crates.io](https://img.shields.io/crates/v/ring_queue.svg)](https://crates.io/crates/ring_queue) [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n\nA double-ended queue implemented using a `Vec` that reuses space after\nelements are removed.\n\nThe API is heavily inspired on `collections.deque` from Python.\n\nYou can create a ring using any of the available constructors or the `ring!` macro.\n\n```rust\n#[macro_use] extern crate ring_queue;\n\nuse ring_queue::Ring;\n\n// `new` for an empty ring.\nlet r: Ring\u003ci32\u003e = Ring::new();\n\n// `with_capacity` for allocating the internal vector with the given\n// capacity.\nlet r2: Ring\u003ci32\u003e = Ring::with_capacity(5);\n\n// `ring!` macro for easy initializing the ring.\nlet r3: Ring\u003ci32\u003e = ring![1, 2, 3];\n\n// `from_iter` to construct the ring from an iterator.\nuse std::iter::FromIterator;\nlet r4: Ring\u003ci32\u003e = Ring::from_iter(vec![1, 2, 3]);\n```\n\nInstead of `front` and `back` as a nomenclature, this library uses `left`\nto refer to the front an nothing to refer to the back, as the Python\n`collections.deque` library does.\n\nItems can be pushed to the left and right as well as popped.\n\n```rust\n#[macro_use] extern crate ring_queue;\n\nuse ring_queue::Ring;\n\nlet mut r = ring![1, 2, 3];\nr.push(4);\nr.push_left(0);\nassert_eq!(r.pop(), Some(4));\nassert_eq!(r.pop_left(), Some(0));\n```\n\nThe ring can be rotated either to the left or to the right. Any positive\nnumber will rotate `n` steps to the right and any negative number will\nrotate `n` steps to the left.\n\n```rust\n#[macro_use] extern crate ring_queue;\n\nuse ring_queue::Ring;\n\nlet mut r = ring![1, 2, 3, 4, 5];\n\nr.rotate(1);\nassert_eq!(r.collect_vec(), vec![5, 1, 2, 3, 4]);\n\nr.rotate(-2);\nassert_eq!(r.collect_vec(), vec![2, 3, 4, 5, 1]);\n```\n\nRing implements `collect` to collect the elements in the ring as a vector\nif the type of the elements implements the `Copy` trait.\n\n```rust\n#[macro_use] extern crate ring_queue;\n\nuse ring_queue::Ring;\n\nlet mut r = ring![1, 2, 3, 4];\nassert_eq!(r.collect_vec(), vec![1, 2, 3, 4]);\n```\n\nIt also implements `into_iter` to generate an iterator. However,\n`into_iter` empties the ring if the elements do not implement the `Copy` trait.\n\n```rust\n#[macro_use] extern crate ring_queue;\n\nuse ring_queue::Ring;\n\n// Since integers implement Copy, an iterator over this ring will not\n// consume the ring itself.\nlet r = ring![1, 2, 3, 4];\nassert_eq!(r.is_empty(), false);\n\nfor item in r.into_iter() {\n    println!(\"{}\", item);\n}\n\nassert_eq!(r.is_empty(), false);\n\n// Element is Vec\u003c{integer}\u003e, so it's not copyable. An iterator for this\n// ring will empty the ring.\nlet mut r2 = ring![vec![1, 2], vec![3, 4]];\n\nfor item in r2.into_iter() {\n    println!(\"{:?}\", item);\n}\n\nassert_eq!(r2.is_empty(), true);\n```\n\n## LICENSE\n\nMIT License, see [LICENSE](/LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ferizocosmico%2Fring_queue","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ferizocosmico%2Fring_queue","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ferizocosmico%2Fring_queue/lists"}