{"id":16373105,"url":"https://github.com/bbqsrc/arc-ext","last_synced_at":"2025-10-26T08:30:21.483Z","repository":{"id":61763627,"uuid":"554860648","full_name":"bbqsrc/arc-ext","owner":"bbqsrc","description":"Extensions for Arc\u003cT\u003e such as field projection.","archived":false,"fork":false,"pushed_at":"2022-10-20T15:07:10.000Z","size":9,"stargazers_count":3,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-31T17:11:32.367Z","etag":null,"topics":["arc","projection","rust"],"latest_commit_sha":null,"homepage":"","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/bbqsrc.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE-APACHE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-10-20T14:20:22.000Z","updated_at":"2022-12-29T06:34:40.000Z","dependencies_parsed_at":"2022-10-20T20:15:30.651Z","dependency_job_id":null,"html_url":"https://github.com/bbqsrc/arc-ext","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bbqsrc%2Farc-ext","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bbqsrc%2Farc-ext/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bbqsrc%2Farc-ext/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bbqsrc%2Farc-ext/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bbqsrc","download_url":"https://codeload.github.com/bbqsrc/arc-ext/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":238293179,"owners_count":19448136,"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":["arc","projection","rust"],"created_at":"2024-10-11T03:13:22.791Z","updated_at":"2025-10-26T08:30:21.190Z","avatar_url":"https://github.com/bbqsrc.png","language":"Rust","readme":"# arc-ext\n\nExtensions for `Arc\u003cT\u003e` such as field projection.\n\n## Usage\n\nThe `ArcExt` trait implementation extends `Arc\u003cT\u003e` with `.project` and `.project_option` methods.\n\nThe projection enforces lifetimes, so that no reference to it can outlive the projection (and therefore is not unsound).\n\nSee the following example:\n\n```rust\nuse arc_ext::ArcExt;\n\n#[derive(Debug, PartialEq, Eq)]\nstruct Top {\n    nested: Nested,\n    string: String,\n}\n\n#[derive(Debug, PartialEq, Eq)]\nstruct Nested {\n    a: u32,\n    b: Box\u003c[u8]\u003e,\n    c: Option\u003cArc\u003cTop\u003e\u003e,\n}\n\nfn test() {\n    let top = Arc::new(Top {\n        nested: Nested {\n            a: 32,\n            b: vec![1, 2, 3, 4].into_boxed_slice(),\n            c: Some(Arc::new(Top {\n                nested: Nested {\n                    a: 12,\n                    b: vec![99].into_boxed_slice(),\n                    c: None,\n                },\n                string: \"nested\".to_string(),\n            })),\n        },\n        string: \"owned str\".to_string(),\n    });\n\n    let project = top.clone().project(|x| \u0026x.nested.b);\n    assert_eq!(\u0026[1, 2, 3, 4], \u0026**project);\n    drop(project);\n\n    let project = top.clone().project_option(|x| x.nested.c.as_ref());\n    let opt = project.as_option().unwrap();\n    assert_eq!(top.nested.c.as_ref().unwrap(), opt);\n}\n\n```\n\n## License\n\nThis project is licensed under either of\n\n * Apache License, Version 2.0 ([LICENSE-APACHE](LICENSE-APACHE) or \u003chttp://www.apache.org/licenses/LICENSE-2.0\u003e)\n * MIT license ([LICENSE-MIT](LICENSE-MIT) or \u003chttp://opensource.org/licenses/MIT\u003e)\n\nat your option.","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbbqsrc%2Farc-ext","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbbqsrc%2Farc-ext","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbbqsrc%2Farc-ext/lists"}