{"id":27202496,"url":"https://github.com/rozbb/rust-iterslide","last_synced_at":"2025-07-31T22:06:17.250Z","repository":{"id":32565588,"uuid":"36148338","full_name":"rozbb/rust-iterslide","owner":"rozbb","description":"A \"sliding window\" iterator.","archived":false,"fork":false,"pushed_at":"2020-04-26T17:42:23.000Z","size":19,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-09T21:59:53.249Z","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":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rozbb.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE-APACHE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-05-24T00:11:35.000Z","updated_at":"2023-11-19T17:21:06.000Z","dependencies_parsed_at":"2022-09-07T23:20:49.545Z","dependency_job_id":null,"html_url":"https://github.com/rozbb/rust-iterslide","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rozbb%2Frust-iterslide","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rozbb%2Frust-iterslide/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rozbb%2Frust-iterslide/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rozbb%2Frust-iterslide/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rozbb","download_url":"https://codeload.github.com/rozbb/rust-iterslide/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248119311,"owners_count":21050754,"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":"2025-04-09T22:00:10.800Z","updated_at":"2025-04-09T22:00:11.444Z","avatar_url":"https://github.com/rozbb.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"rust-iterslide\n===============\n\n[![Version](https://img.shields.io/crates/v/iterslide.svg)](https://crates.io/crates/iterslide)\n[![Docs](https://docs.rs/iterslide/badge.svg)](https://docs.rs/iterslide)\n[![Build Status](https://travis-ci.org/rozbb/rust-iterslide.svg?branch=master)](https://travis-ci.org/rozbb/rust-iterslide)\n\nThis package implements \"sliding window\" functionality for any iterator over a `Clone`able item.\n\nExample\n-------\n\n```rust\nuse iterslide::SlideIterator;\n\nfn main() {\n    let v: Vec\u003ci8\u003e = vec![1, 2, 3, 4, 5];\n\n    for window in v.slide(3) {\n        // window is a VecDeque\u003ci8\u003e\n        println!(\"{:?}\", window);\n    }\n}\n```\n\nOutput:\n\n```\n[1, 2, 3]\n[2, 3, 4]\n[3, 4, 5]\n```\n\nAlternatives\n------------\n\n* Rust's [`windows`](https://doc.rust-lang.org/std/primitive.slice.html#method.windows) method for slices does what you would expect. This does no allocation. However, this is only implemented for slices.\n\n* itertools' [`tuple_windows`](https://docs.rs/itertools/0.9.0/itertools/trait.Itertools.html#method.tuple_windows) method returns a sliding window iterator over tuples instead of `VecDeques`. This saves a `VecDeque` allocation in construction of the iterator. However, `tuple_windows` is limited to window sizes of at most 4.\n\nLicense\n-------\n\nLicensed under either of\n\n * Apache License, Version 2.0, ([LICENSE-APACHE](LICENSE-APACHE))\n * MIT license ([LICENSE-MIT](LICENSE-MIT))\n\nat your option.\n\nContribution\n------------\n\nUnless you explicitly state otherwise, any contribution intentionally submitted\nfor inclusion in the work by you shall be dual licensed as above, without any\nadditional terms or conditions.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frozbb%2Frust-iterslide","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frozbb%2Frust-iterslide","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frozbb%2Frust-iterslide/lists"}