{"id":15523323,"url":"https://github.com/maxcountryman/headers-accept","last_synced_at":"2025-04-23T05:15:50.359Z","repository":{"id":236151294,"uuid":"792039270","full_name":"maxcountryman/headers-accept","owner":"maxcountryman","description":"🤝 The missing `Accept` implementation for `headers::Header`.","archived":false,"fork":false,"pushed_at":"2024-09-14T22:05:17.000Z","size":23,"stargazers_count":11,"open_issues_count":0,"forks_count":3,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-23T05:15:45.313Z","etag":null,"topics":["accept","content-negotiation","headers"],"latest_commit_sha":null,"homepage":"","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/maxcountryman.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":"2024-04-25T21:22:34.000Z","updated_at":"2025-02-25T10:15:28.000Z","dependencies_parsed_at":"2024-05-06T19:00:37.763Z","dependency_job_id":"a5f4d392-f335-43b5-bec6-2b95be6422c6","html_url":"https://github.com/maxcountryman/headers-accept","commit_stats":null,"previous_names":["maxcountryman/headers-accept"],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maxcountryman%2Fheaders-accept","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maxcountryman%2Fheaders-accept/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maxcountryman%2Fheaders-accept/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maxcountryman%2Fheaders-accept/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/maxcountryman","download_url":"https://codeload.github.com/maxcountryman/headers-accept/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250372944,"owners_count":21419724,"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":["accept","content-negotiation","headers"],"created_at":"2024-10-02T10:44:44.246Z","updated_at":"2025-04-23T05:15:50.344Z","avatar_url":"https://github.com/maxcountryman.png","language":"Rust","readme":"\u003ch1 align=\"center\"\u003e\n    headers-accept\n\u003c/h1\u003e\n\n\u003cp align=\"center\"\u003e\n    🤝 The missing `Accept` implementation for `headers::Header`\n\u003c/p\u003e\n\n\u003cdiv align=\"center\"\u003e\n    \u003ca href=\"https://crates.io/crates/headers-accept\"\u003e\n        \u003cimg src=\"https://img.shields.io/crates/v/headers-accept.svg\" /\u003e\n    \u003c/a\u003e\n    \u003ca href=\"https://docs.rs/headers-accept\"\u003e\n        \u003cimg src=\"https://docs.rs/headers-accept/badge.svg\" /\u003e\n    \u003c/a\u003e\n    \u003ca href=\"https://github.com/maxcountryman/headers-accept/actions/workflows/rust.yml\"\u003e\n        \u003cimg src=\"https://github.com/maxcountryman/headers-accept/actions/workflows/rust.yml/badge.svg\" /\u003e\n    \u003c/a\u003e\n\u003c/div\u003e\n\n## 🎨 Overview\n\nThis crate provides an implementation of `headers::Header` for `Accept`.\n\nWhile other crates exist, they either rely on stagnant crates like `mime` (`headers-accept` uses `mediatype` instead) or deviate from RFC 9110 (by imposing onerous sort logic) or both.\n\nThis crate aims to solve these problems while adhereing to the spec outlined in [section 12.5.1](https://www.rfc-editor.org/rfc/rfc9110.html#section-12.5.1).\n\n## 📦 Install\n\nTo use the crate in your project, add the following to your `Cargo.toml` file:\n\n```toml\n[dependencies]\nheaders-accept = \"0.1.4\"\n```\n\n## 🤸 Usage\n\n### Example\n\n```rust\nuse std::str::FromStr;\n\nuse headers_accept::Accept;\nuse mediatype::MediaTypeBuf;\n\nlet accept = Accept::from_str(\"audio/*; q=0.2, audio/basic\").unwrap();\nlet mut media_types = accept.media_types();\nassert_eq!(\n    media_types.next(),\n    Some(\u0026MediaTypeBuf::from_str(\"audio/basic\").unwrap())\n);\nassert_eq!(\n    media_types.next(),\n    Some(\u0026MediaTypeBuf::from_str(\"audio/*; q=0.2\").unwrap())\n);\nassert_eq!(media_types.next(), None);\n```\n\n## 🦺 Safety\n\nThis crate uses `#![forbid(unsafe_code)]` to ensure everything is implemented in 100% safe Rust.\n\n## 👯 Contributing\n\nWe appreciate all kinds of contributions, thank you!\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmaxcountryman%2Fheaders-accept","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmaxcountryman%2Fheaders-accept","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmaxcountryman%2Fheaders-accept/lists"}