{"id":16647555,"url":"https://github.com/optimisticpeach/overloadable","last_synced_at":"2025-03-16T22:31:58.512Z","repository":{"id":57651037,"uuid":"196772646","full_name":"OptimisticPeach/overloadable","owner":"OptimisticPeach","description":"Overloadable functions in rust.","archived":false,"fork":false,"pushed_at":"2019-08-08T21:13:59.000Z","size":23,"stargazers_count":41,"open_issues_count":0,"forks_count":2,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-10-13T08:45:06.446Z","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":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/OptimisticPeach.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-07-13T22:46:14.000Z","updated_at":"2024-02-10T09:57:07.000Z","dependencies_parsed_at":"2022-09-05T13:41:27.436Z","dependency_job_id":null,"html_url":"https://github.com/OptimisticPeach/overloadable","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OptimisticPeach%2Foverloadable","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OptimisticPeach%2Foverloadable/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OptimisticPeach%2Foverloadable/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OptimisticPeach%2Foverloadable/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/OptimisticPeach","download_url":"https://codeload.github.com/OptimisticPeach/overloadable/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":221668861,"owners_count":16860742,"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":[],"created_at":"2024-10-12T08:45:06.886Z","updated_at":"2024-10-27T11:29:45.154Z","avatar_url":"https://github.com/OptimisticPeach.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# overloadable\n\nEasy to use overloadable functions in rust using nightly features.\n\nThis crate provides you with the capabilities to overload your functions in a similar style to C# or C++, including support for meta attributes, type parameters and constraints, and visibility modifiers. \nPlease visit the documentation for futher information. \n\n# Note\nThis is a **nightly** crate. You _must_ include the following line in your code for this crate to compile:\n```rust\n#![feature(unboxed_closures, fn_traits)]\n```\n\n## Example:\n\n```rust\n#![feature(unboxed_closures, fn_traits)]\nuse overloadable::overloadable;\n\noverloadable! {\n    pub func as\n    #[inline(always)]\n    fn(x: usize, y: usize) -\u003e usize {\n        x * y\n    },\n    fn\u003c'a\u003e(x: \u0026'a usize) -\u003e f32 {\n        *x as f32\n    },\n    fn\u003c'a, T\u003e(x: \u0026'a [T]) -\u003e \u0026'a T where T: std::fmt::Debug {\n        println!(\"Found {:?}\", \u0026x[0]);\n        \u0026x[0]\n    }\n}\n\nfn foo() {\n    assert_eq!(func(2, 3), 6);\n    assert_eq!(func(\u002632), 32.0);\n    assert_eq!(func(\u0026[1, 2, 3, 4][..]), \u00260);\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foptimisticpeach%2Foverloadable","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Foptimisticpeach%2Foverloadable","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foptimisticpeach%2Foverloadable/lists"}