{"id":23705343,"url":"https://github.com/yewstack/implicit-clone","last_synced_at":"2025-09-03T10:32:18.377Z","repository":{"id":42039935,"uuid":"465726061","full_name":"yewstack/implicit-clone","owner":"yewstack","description":"Immutable types and ImplicitClone trait similar to Copy","archived":false,"fork":false,"pushed_at":"2025-03-10T17:42:36.000Z","size":97,"stargazers_count":22,"open_issues_count":4,"forks_count":11,"subscribers_count":8,"default_branch":"main","last_synced_at":"2025-08-07T11:16:17.715Z","etag":null,"topics":["cheap-clone","copy","immutable","rc"],"latest_commit_sha":null,"homepage":"","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/yewstack.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","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},"funding":{"github":"cecton"}},"created_at":"2022-03-03T13:16:23.000Z","updated_at":"2025-08-07T00:44:07.000Z","dependencies_parsed_at":"2023-10-24T19:34:30.277Z","dependency_job_id":"fdff5e04-3c10-4689-b014-771cfd0be0e0","html_url":"https://github.com/yewstack/implicit-clone","commit_stats":{"total_commits":81,"total_committers":9,"mean_commits":9.0,"dds":"0.19753086419753085","last_synced_commit":"b757b453dc63b6fe2068661d48aff1fc7b100961"},"previous_names":[],"tags_count":22,"template":false,"template_full_name":null,"purl":"pkg:github/yewstack/implicit-clone","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yewstack%2Fimplicit-clone","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yewstack%2Fimplicit-clone/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yewstack%2Fimplicit-clone/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yewstack%2Fimplicit-clone/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/yewstack","download_url":"https://codeload.github.com/yewstack/implicit-clone/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yewstack%2Fimplicit-clone/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":273430350,"owners_count":25104479,"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","status":"online","status_checked_at":"2025-09-03T02:00:09.631Z","response_time":76,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["cheap-clone","copy","immutable","rc"],"created_at":"2024-12-30T14:35:56.287Z","updated_at":"2025-09-03T10:32:18.082Z","avatar_url":"https://github.com/yewstack.png","language":"Rust","readme":"![Rust](https://github.com/yewstack/implicit-clone/actions/workflows/rust.yml/badge.svg)\n[![Latest Version](https://img.shields.io/crates/v/implicit-clone.svg)](https://crates.io/crates/implicit-clone)\n![License](https://img.shields.io/crates/l/implicit-clone)\n[![Docs.rs](https://docs.rs/implicit-clone/badge.svg)](https://docs.rs/implicit-clone)\n[![LOC](https://tokei.rs/b1/github/yewstack/implicit-clone)](https://github.com/yewstack/implicit-clone)\n[![Dependency Status](https://deps.rs/repo/github/yewstack/implicit-clone/status.svg)](https://deps.rs/repo/github/yewstack/implicit-clone)\n\n\u003c!-- cargo-rdme start --\u003e\n\n# ImplicitClone\n\nThis library introduces the marker trait [`ImplicitClone`](https://docs.rs/implicit-clone/latest/implicit_clone/trait.ImplicitClone.html) intended for\ncheap-to-clone types that should be allowed to be cloned implicitly. It enables host libraries\nusing this crate to have the syntax of [`Copy`][std::marker::Copy] while actually calling the\n[`Clone`][std::clone::Clone] implementation instead (usually when host library does such syntax\nin a macro).\n\nThe idea is that you must implement this trait on your cheap-to-clone types, and then the host\nlibrary using the trait will allow users to pass values of your types and they will be cloned\nautomatically.\n\nStandard types that the [`ImplicitClone`](https://docs.rs/implicit-clone/latest/implicit_clone/trait.ImplicitClone.html) is already implemented for:\n\n- [`std::rc::Rc`][std::rc::Rc]\n- [`std::sync::Arc`][std::sync::Arc]\n- Tuples with 1-12 elements, all of which are also [`ImplicitClone`](https://docs.rs/implicit-clone/latest/implicit_clone/trait.ImplicitClone.html)\n- [`Option`][std::option::Option], where inner value is [`ImplicitClone`](https://docs.rs/implicit-clone/latest/implicit_clone/trait.ImplicitClone.html)\n- Some built-in [`Copy`][std::marker::Copy] types, like `()`, `bool`, `\u0026T`, etc.\n\nThis crate is in the category `rust-patterns` but this is actually a Rust anti-pattern. In Rust\nthe user should always handle borrowing and ownership by themselves. Nevertheless, this pattern\nis sometimes desirable. For example, UI frameworks that rely on propagating properties from\nancestors to multiple children will always need to use `Rc`'d types to cheaply and concisely\nupdate every child component. This is the case in React-like frameworks like\n[Yew](https://yew.rs/).\n\nThis crate also provides a few convenient immutable types for handling cheap-to-clone strings,\narrays and maps, you can find them in the modules [`sync`](https://docs.rs/implicit-clone/latest/implicit_clone/sync/) and\n[`unsync`](https://docs.rs/implicit-clone/latest/implicit_clone/unsync/). Those types implement [`ImplicitClone`](https://docs.rs/implicit-clone/latest/implicit_clone/trait.ImplicitClone.html) and\nhold only types that implement [`ImplicitClone`](https://docs.rs/implicit-clone/latest/implicit_clone/trait.ImplicitClone.html) as well. **One big\nparticularity: iterating on these types yields clones of the items and not references.** This\ncan be particularly handy when using a React-like framework.\n\n[std::marker::Copy]: https://doc.rust-lang.org/std/marker/trait.Copy.html\n[std::clone::Clone]: https://doc.rust-lang.org/std/clone/trait.Clone.html\n[std::rc::Rc]: https://doc.rust-lang.org/std/rc/struct.Rc.html\n[std::sync::Arc]: https://doc.rust-lang.org/std/sync/struct.Arc.html\n[std::option::Option]: https://doc.rust-lang.org/stable/std/option/enum.Option.html\n\n\u003c!-- cargo-rdme end --\u003e\n","funding_links":["https://github.com/sponsors/cecton"],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyewstack%2Fimplicit-clone","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyewstack%2Fimplicit-clone","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyewstack%2Fimplicit-clone/lists"}