{"id":19429770,"url":"https://github.com/chayleaf/urn","last_synced_at":"2025-04-24T18:32:50.473Z","repository":{"id":57671298,"uuid":"409334261","full_name":"chayleaf/urn","owner":"chayleaf","description":"A Rust crate for parsing URNs","archived":false,"fork":false,"pushed_at":"2023-04-20T11:22:52.000Z","size":68,"stargazers_count":8,"open_issues_count":2,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-10-12T02:24:37.963Z","etag":null,"topics":["rust"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"0bsd","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/chayleaf.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE-0BSD","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-09-22T19:40:25.000Z","updated_at":"2023-08-25T09:55:21.000Z","dependencies_parsed_at":"2023-02-08T07:25:14.114Z","dependency_job_id":null,"html_url":"https://github.com/chayleaf/urn","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/chayleaf%2Furn","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chayleaf%2Furn/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chayleaf%2Furn/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chayleaf%2Furn/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/chayleaf","download_url":"https://codeload.github.com/chayleaf/urn/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223962606,"owners_count":17232503,"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":["rust"],"created_at":"2024-11-10T14:21:06.695Z","updated_at":"2024-11-10T14:21:07.495Z","avatar_url":"https://github.com/chayleaf.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![crates.io](https://img.shields.io/crates/v/urn.svg)](https://crates.io/crates/urn)\n[![docs.rs](https://docs.rs/urn/badge.svg)](https://docs.rs/urn)\n\n# URN\n\nA Rust crate for handling\n[URNs](https://datatracker.ietf.org/doc/html/rfc8141). Parsing\nand comparison is done according to the spec (meaning only part of the\nURN is used for equality checks). Some RFCs define per-namespace lexical\nequivalence rules, those aren't taken into account here.\n\nRFC2141 is more lenient than RFC8141 at times (and vice versa), care is\ntaken to be able to parse either of them. When percent encoding URN\ncomponents, the resulting URNs will always be valid for both RFC2141 and\nRFC8141 parsers. However, percent encoding/decoding rules may be\ndifferent for some namespaces.\n\nSerde support is available behind a feature flag. `no_std` support is\navailable if you disable the default \"std\" feature. `alloc` is optional\nas well. `UrnSlice` is a borrowed URN, `Urn` is an owned URN. See\n[docs.rs](https://docs.rs/urn) for documentation.\n\nURNs have a surprising amount of obscure details to the point I'm not\nsure if other URN parsers can be trusted! Granted, there's very little\nof them because almost nobody really needs URNs...\n\n## Roadmap\n\nCurrently, I'm looking for options to integrate with the\n`percent-encoding` crate. If that isn't possible, I still want to make\npercent-encoding/decoding functions return an iterator rather than a\n`String`. Once that's done, I think the crate will be ready for 1.0.\n\nAdditionally, I may add functions for getting certain subslices of the\nURN. For example, the RFC recommends not to pass the q-component and the\nf-component to resolution services, so I can add a function that returns\nthe part of the URN that doesn't have the q-component and f-component.\nThe only open question for this API is the naming.\n\n## Changelog\n\n- 0.1.0 - initial release\n- 0.1.1 - add `FromStr` impl\n- 0.2.0 - remove `Urn::parse` function in favor of `FromStr`, improved\n  docs\n- 0.2.1 - remove files left over from 0.1\n- 0.3.0 - major implementation changes, remove `Namespace` (thanks to\n  u/chris-morgan for help)\n- 0.3.1 - fix a panic on empty NSS and add \"?=\" terminator to\n  r-component (both \"?\" and \"=\" can be part of r-component, but together\n  they terminate it)\n- 0.3.2 - add `Clone` impl for `Urn`\n- 0.3.3 - more precise builder errors; reduce memory footprint by up to\n  15 bytes (but increase it by 5 bytes on 16-bit platforms)\n- 0.3.4 - Serde support by @callym\n- 0.4.0 - `UrnBuilder::namespace` -\u003e `UrnBuilder::nid`\n- 0.5.0 - changed builder API to accept options for optional components,\n  minor cleanup, fixed a couple potential minor bugs\n- 0.5.1 - fix a panic in case there wasn't a valid utf-8 char boundary 4\n  bytes into the string\n- 0.6.0 - add `alloc` feature, add `UrnSlice` type, add `percent`\n  module, don't impl `Deref\u003cTarget = str\u003e`. The crate is getting close\n  to 1.0.\n- 0.7.0 - add support for deserializing non-`'static` `UrnSlice`s,\n  always encode valid RFC2141 URNs, check for empty string in\n  `percent::encode_*`.\n\n## License\n\nTL;DR do whatever you want.\n\nLicensed under either the [BSD Zero Clause License](LICENSE-0BSD)\n(https://opensource.org/licenses/0BSD), the [Apache 2.0\nLicense](LICENSE-APACHE) (http://www.apache.org/licenses/LICENSE-2.0) or\nthe [MIT License](LICENSE-MIT) (http://opensource.org/licenses/MIT), at\nyour choice.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchayleaf%2Furn","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fchayleaf%2Furn","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchayleaf%2Furn/lists"}