{"id":22297458,"url":"https://github.com/rustonaut/maybe-owned","last_synced_at":"2026-03-06T03:33:01.604Z","repository":{"id":57637140,"uuid":"91564933","full_name":"rustonaut/maybe-owned","owner":"rustonaut","description":"provides a `MaybeOwned\u003c'a,T\u003e` type different to std's `Cow` it implements `From\u003cT\u003e` and `From\u003c\u0026'a T\u003e` and does not require `ToOwned`","archived":false,"fork":false,"pushed_at":"2023-03-05T18:28:17.000Z","size":71,"stargazers_count":31,"open_issues_count":1,"forks_count":5,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-08-28T17:10:15.420Z","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":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rustonaut.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE-APACHE","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":"2017-05-17T10:38:20.000Z","updated_at":"2025-04-22T18:01:18.000Z","dependencies_parsed_at":"2024-06-20T22:00:52.114Z","dependency_job_id":null,"html_url":"https://github.com/rustonaut/maybe-owned","commit_stats":{"total_commits":42,"total_committers":7,"mean_commits":6.0,"dds":"0.45238095238095233","last_synced_commit":"12afe869fcdea5205a9d93385e0e338261cb21be"},"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/rustonaut/maybe-owned","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rustonaut%2Fmaybe-owned","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rustonaut%2Fmaybe-owned/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rustonaut%2Fmaybe-owned/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rustonaut%2Fmaybe-owned/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rustonaut","download_url":"https://codeload.github.com/rustonaut/maybe-owned/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rustonaut%2Fmaybe-owned/sbom","scorecard":{"id":790753,"data":{"date":"2025-08-11","repo":{"name":"github.com/rustonaut/maybe-owned","commit":"12afe869fcdea5205a9d93385e0e338261cb21be"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.5,"checks":[{"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":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","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":"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":"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":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/rust.yml:18: update your workflow using https://app.stepsecurity.io/secureworkflow/rustonaut/maybe-owned/rust.yml/main?enable=pin","Info:   0 out of   1 GitHub-owned GitHubAction dependencies pinned"],"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":"Code-Review","score":1,"reason":"Found 4/27 approved changesets -- score normalized to 1","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":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/rust.yml:1","Info: no jobLevel write permissions found"],"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":"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-APACHE:0","Info: FSF or OSI recognized license: Apache License 2.0: LICENSE-APACHE: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 'main'"],"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 7 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-23T07:27:53.851Z","repository_id":57637140,"created_at":"2025-08-23T07:27:53.851Z","updated_at":"2025-08-23T07:27:53.851Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29332717,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-11T06:13:03.264Z","status":"ssl_error","status_checked_at":"2026-02-11T06:12:55.843Z","response_time":97,"last_error":"SSL_read: 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":[],"created_at":"2024-12-03T17:49:51.497Z","updated_at":"2026-03-06T03:33:01.580Z","avatar_url":"https://github.com/rustonaut.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n# maybe-owned [![Crates.io](https://img.shields.io/crates/v/maybe-owned.svg)](https://crates.io/crates/maybe-owned) [![maybe-owned](https://docs.rs/maybe-owned/badge.svg)](https://docs.rs/maybe-owned) [![maintenance](https://img.shields.io/badge/maintenance-passively--maintained-blue.svg)](https://img.shields.io/badge/maintenance-passively--maintained-blue.svg) [![License](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT) [![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)\n\n**provides a `MaybeOwned\u003c'a,T\u003e` type different to std's `Cow` it implements `From\u003cT\u003e` and `From\u003c\u0026'a T\u003e` and does not require `ToOwned`**\n\n---\n\nThis crate provides a `MaybeOwned\u003c'a,T\u003e` enum. Different to `std::borrow::Cow` it\nimplements `From\u003cT\u003e` and `From\u003c\u0026'a T\u003e` and does not require a `ToOwned` implementation.\nWhile this can be nice for API's mainly consuming `T`'s not implementing `ToOwned` or implementing\n`ToOwned` through `Clone` it also means it's borrowed version of `String` is\n`\u0026String` and not `\u0026str` making it less performant for cases like `String` or `Vec`.\n\n\nDocumentation can be [viewed on docs.rs](https://docs.rs/maybe-owned).\n\n\n## Example\n\nTake a look at the [examples dir](./examples) and the documentation\nfor more complete examples.\n\nThe main benefit of `MaybeOwned` over `Cow` is for API design,\nallowing API consumer to pass in both `T` and `\u0026'a T`:\n\n```rust\n\n//... in a trait implementation\n    fn register\u003cD\u003e(\u0026mut self, key: SomeId, data: D)\n        where D: Into\u003cMaybeOwned\u003c'a, Data\u003e\u003e\n    {\n        self.map.entry(key).or_insert_with(||data.into());\n    }\n//...\n\n//... in usage\n    // use owned data\n    registry.register(id1, data_owned);\n    // use a reference to the data\n    registry.register(id2, \u0026data_ref);\n    // it ok to use the same reference again\n    registry.register(id3, \u0026data_ref);\n//...\n```\n\n## License\n\nLicensed under either of\n\n * Apache License, Version 2.0, ([LICENSE-APACHE](LICENSE-APACHE) or http://www.apache.org/licenses/LICENSE-2.0)\n * MIT license ([LICENSE-MIT](LICENSE-MIT) or http://opensource.org/licenses/MIT)\n\nat your option.\n\n### Contribution\n\nUnless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.\n\nContributors: [./CONTRIBUTORS.md](./CONTRIBUTORS.md)\n\nChange Log\n-----------\n\nSee [./CHANGELOG.md](./CHANGELOG.md)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frustonaut%2Fmaybe-owned","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frustonaut%2Fmaybe-owned","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frustonaut%2Fmaybe-owned/lists"}