{"id":25321487,"url":"https://github.com/aweirddev/niceowner","last_synced_at":"2026-02-13T22:05:22.464Z","repository":{"id":271104231,"uuid":"912428472","full_name":"AWeirdDev/niceowner","owner":"AWeirdDev","description":"A stupid library that allows you to own a value, even if it comes from a reference. No cloning.","archived":false,"fork":false,"pushed_at":"2025-01-05T14:58:35.000Z","size":2,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-06T12:16:40.406Z","etag":null,"topics":["borrowing","ownership","rust","rust-ownership"],"latest_commit_sha":null,"homepage":"https://crates.io/crates/niceowner","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/AWeirdDev.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2025-01-05T14:53:18.000Z","updated_at":"2025-01-05T14:58:39.000Z","dependencies_parsed_at":"2025-01-05T15:09:52.911Z","dependency_job_id":"11429fc5-590b-48fb-b3c3-77bd67bb3527","html_url":"https://github.com/AWeirdDev/niceowner","commit_stats":null,"previous_names":["aweirddev/niceowner"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AWeirdDev%2Fniceowner","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AWeirdDev%2Fniceowner/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AWeirdDev%2Fniceowner/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AWeirdDev%2Fniceowner/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AWeirdDev","download_url":"https://codeload.github.com/AWeirdDev/niceowner/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":238747865,"owners_count":19523849,"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":["borrowing","ownership","rust","rust-ownership"],"created_at":"2025-02-13T22:53:58.055Z","updated_at":"2025-10-29T00:31:20.861Z","avatar_url":"https://github.com/AWeirdDev.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# niceowner\n\nA stupid library that allows you to own a value, even if it comes from a reference. No cloning.\n\nYou can use this with an `Rc` or `Arc`, if you're interested in cloning the reference of `NiceOwner`.\n\n## Usage\n\n```rust\nuse niceowner::NiceOwner;\n\nstruct Dog {\n    name: String,\n}\n\nfn lend_to_amy(no: \u0026mut NiceOwner\u003cDog\u003e) {\n    // The dog is essentially *borrowed*.\n    // But now Amy is going to own it... somehow.\n    let mut dog = no.own().unwrap();\n    dog.name = String::from(\"Amy's dog\");\n\n    // Amy remembers to return the dog back to the owner.\n    no.return_value(dog);\n}\n\nfn main() {\n    let dog = Dog { name: String::from(\"Dee'O G\") };\n    let mut owned_dog = NiceOwner::new(dog);\n\n    // The owner is going abroad, so let's ask Amy to take care of the dog.\n    lend_to_amy(\u0026mut owned_dog);\n\n    // The owner sees the nametag of the dog.\n    println!(\"The name of the dog is {:?}\", owned_dog.name); // \"Amy's dog\"\n\n    // The dog now obeys Amy! :O\n}\n```\n\n***\n\n(c) 2025 AWeirdDev\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faweirddev%2Fniceowner","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faweirddev%2Fniceowner","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faweirddev%2Fniceowner/lists"}