{"id":20089918,"url":"https://github.com/bugadani/slidingwindow","last_synced_at":"2025-05-06T03:30:32.727Z","repository":{"id":57667657,"uuid":"261110801","full_name":"bugadani/SlidingWindow","owner":"bugadani","description":"Rust implementation of a sliding window","archived":false,"fork":false,"pushed_at":"2020-05-15T12:33:24.000Z","size":27,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-09T07:41:34.777Z","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/bugadani.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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":"2020-05-04T07:46:00.000Z","updated_at":"2020-10-18T14:53:21.000Z","dependencies_parsed_at":"2022-09-03T11:22:00.010Z","dependency_job_id":null,"html_url":"https://github.com/bugadani/SlidingWindow","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bugadani%2FSlidingWindow","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bugadani%2FSlidingWindow/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bugadani%2FSlidingWindow/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bugadani%2FSlidingWindow/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bugadani","download_url":"https://codeload.github.com/bugadani/SlidingWindow/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252615958,"owners_count":21776890,"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-11-13T16:20:45.243Z","updated_at":"2025-05-06T03:30:32.460Z","avatar_url":"https://github.com/bugadani.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"SlidingWindow [![crates.io](https://img.shields.io/crates/v/sliding_window.svg)](https://crates.io/crates/sliding_window)\n=============\n\nSliding windows are used to hold the N most recent samples of a data stream.\n\n[Documentation](https://docs.rs/sliding_window/0.1.0/sliding_window/)\n\nExample\n-------\n\n```rust\nuse sliding_window::*;\nuse sliding_window::typenum::consts::*;\n\n// Create a SlidingWindow with a window size of 4 elements\nlet mut sw: SlidingWindow\u003c_, U4\u003e = SlidingWindow::new();\n\n// Insert some data\nsw.insert(1);\nsw.insert(2);\nsw.insert(3);\nsw.insert(4);\n\n// The 0 index always returns the oldest element in the window\nassert_eq!(1, sw[0]);\n\n// When full, inserting a new element removes and returns the oldest\nassert_eq!(Some(1), sw.insert(5));\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbugadani%2Fslidingwindow","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbugadani%2Fslidingwindow","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbugadani%2Fslidingwindow/lists"}