{"id":18219589,"url":"https://github.com/hanepjiv/elicit-rs","last_synced_at":"2026-02-26T08:34:33.319Z","repository":{"id":57624177,"uuid":"55402566","full_name":"hanepjiv/elicit-rs","owner":"hanepjiv","description":"SmartPointer-like structure for polymorphism.","archived":false,"fork":false,"pushed_at":"2025-04-02T09:40:02.000Z","size":382,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-02T10:35:22.556Z","etag":null,"topics":["rust","rust-crate","rust-crates","rust-library"],"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/hanepjiv.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE-APACHE-2.0","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":"2016-04-04T10:27:28.000Z","updated_at":"2025-04-02T09:40:06.000Z","dependencies_parsed_at":"2024-04-06T11:29:57.520Z","dependency_job_id":"216b7c30-832d-4bab-a2a4-9c8d4e2f4a3f","html_url":"https://github.com/hanepjiv/elicit-rs","commit_stats":{"total_commits":111,"total_committers":1,"mean_commits":111.0,"dds":0.0,"last_synced_commit":"e0076a47c032b914421c4bc3281bb6fddadd770e"},"previous_names":[],"tags_count":37,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hanepjiv%2Felicit-rs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hanepjiv%2Felicit-rs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hanepjiv%2Felicit-rs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hanepjiv%2Felicit-rs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hanepjiv","download_url":"https://codeload.github.com/hanepjiv/elicit-rs/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246910757,"owners_count":20853642,"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","rust-crate","rust-crates","rust-library"],"created_at":"2024-11-03T19:04:48.572Z","updated_at":"2026-02-26T08:34:28.278Z","avatar_url":"https://github.com/hanepjiv.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# elicit-rs\n\n## Build Status\n\n- [main](https://github.com/hanepjiv/elicit-rs/tree/main): [![CI Rust](https://github.com/hanepjiv/elicit-rs/actions/workflows/ci-rust.yml/badge.svg)](https://github.com/hanepjiv/elicit-rs/actions/workflows/ci-rust.yml)\n\n# Examples\n\n## Elicit\n\n```\npub(crate) mod mine {\n    use elicit::{elicit_define, Elicit};\n\n    #[elicit_define(mine_elicit)]\n    pub(crate) trait Mine {\n        fn action(\u0026self) -\u003e i32;\n        fn action_mut(\u0026mut self) -\u003e i32;\n    }\n\n    // pub(crate) mine_elicit::author as elicit_author;\n    pub(crate) use mine_elicit::user as elicit_user;\n\n    #[derive(Debug, Default, Clone, Elicit)]\n    #[elicit_mod_author(mine_elicit::author)]\n    pub(crate) struct X {}\n\n    impl Mine for X {\n        fn action(\u0026self) -\u003e i32 {\n            0i32\n        }\n        fn action_mut(\u0026mut self) -\u003e i32 {\n            0i32\n        }\n    }\n\n    #[derive(Debug, Clone, Elicit)]\n    #[elicit_mod_author(mine_elicit::author)]\n    // #[elicit_from_self_field(_fsf)] // here\n    pub(crate) struct Y {\n        #[elicit_from_self_field] // or here\n        _fsf: mine_elicit::author::ElicitFromSelfField,\n        i: i32,\n    }\n\n    impl Y {\n        pub(crate) fn new(a: i32) -\u003e Self {\n            Y {\n                _fsf: Default::default(),\n                i: a,\n            }\n        }\n    }\n\n    impl Mine for Y {\n        fn action(\u0026self) -\u003e i32 {\n            self.i\n        }\n        fn action_mut(\u0026mut self) -\u003e i32 {\n            self.i += 1;\n            self.i\n        }\n    }\n}\n\npub(crate) fn fire() -\u003e elicit::Result\u003c()\u003e {\n    use mine::elicit_user::Elicit as MineElicit;\n    use mine::{X, Y};\n\n    let mut e: MineElicit;\n\n    e = MineElicit::new(X::default())?;\n\n    e.try_with(|m| -\u003e elicit::Result\u003c()\u003e {\n    println!(\"{:?}\", m);\n        assert!(m.action() == 0);\n        Ok(())\n    })?;\n\n    let y = Y::new(1);\n    e = MineElicit::new(y)?;\n\n    e.try_with_mut(|m| -\u003e elicit::Result\u003c()\u003e {\n        println!(\"{:?}\", m);\n        assert!(m.action_mut() == 2);\n        Ok(())\n    })?;\n\n    Ok(())\n}\n\nfire().expect(\"Doc-tests\");\n```\n\n## License\n\nLicensed under either of\n\n * Apache License, Version 2.0\n   ([LICENSE-APACHE-2.0](LICENSE-APACHE-2.0) or http://www.apache.org/licenses/LICENSE-2.0)\n * MIT license\n   ([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\nfor inclusion in the work by you, as defined in the Apache-2.0 license, shall be\ndual licensed as above, without any additional terms or conditions.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhanepjiv%2Felicit-rs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhanepjiv%2Felicit-rs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhanepjiv%2Felicit-rs/lists"}