{"id":21633956,"url":"https://github.com/tweedegolf/autoerror","last_synced_at":"2025-03-18T22:38:07.352Z","repository":{"id":62438393,"uuid":"360797338","full_name":"tweedegolf/autoerror","owner":"tweedegolf","description":null,"archived":false,"fork":false,"pushed_at":"2021-04-23T07:22:18.000Z","size":5,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-01-25T00:14:57.015Z","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/tweedegolf.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":"2021-04-23T07:17:34.000Z","updated_at":"2021-04-25T08:55:56.000Z","dependencies_parsed_at":"2022-11-01T23:33:16.821Z","dependency_job_id":null,"html_url":"https://github.com/tweedegolf/autoerror","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/tweedegolf%2Fautoerror","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tweedegolf%2Fautoerror/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tweedegolf%2Fautoerror/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tweedegolf%2Fautoerror/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tweedegolf","download_url":"https://codeload.github.com/tweedegolf/autoerror/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244320300,"owners_count":20434088,"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-11-25T03:14:47.557Z","updated_at":"2025-03-18T22:38:07.326Z","avatar_url":"https://github.com/tweedegolf.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"Derive basic error type infrastruture for enum types.\n\nSupports unnamed and unit enum variants, and uses the type definition\nto derive `std::fmt::Display` and `std::error:Error` for the error type,\nas well as `std::from::From\u003cT\u003e` for any unnamed variant with one parameter\ninferred to be an error type (currently determined by whether it's type\nname is Error).\n\nDefault behaviour can be overridden with the auto_error attribute\n- format_str takes a string which becomes the format string for that\n  variant\n- make_from forces derivation of std::from::From when set to true\n- err forces the std::error::Error implementation to return the inner\n  type during calls to source, or in other words to treat the inner\n  type as an error type.\n\nFrom derivation and source returning work only for variants with a single field.\n\n# Example\n\n```\n#[derive(AutoError)]\nuse autoerror::AutoError;\n\nenum Error {\n    #[auto_error(format_str=\"Document not found\")]\n    NotFound,\n    IO(std::io::Error),\n    #[auto_error(make_from=true)]\n    Other(String),\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftweedegolf%2Fautoerror","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftweedegolf%2Fautoerror","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftweedegolf%2Fautoerror/lists"}