{"id":31901035,"url":"https://github.com/berrysoft/fallback","last_synced_at":"2025-10-13T12:52:02.512Z","repository":{"id":58975117,"uuid":"534856340","full_name":"Berrysoft/fallback","owner":"Berrysoft","description":"A helper library to implement fallback mechaism.","archived":false,"fork":false,"pushed_at":"2024-01-13T10:31:04.000Z","size":8,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-09-28T06:36:55.742Z","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/Berrysoft.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,"governance":null,"roadmap":null,"authors":null}},"created_at":"2022-09-10T01:19:51.000Z","updated_at":"2022-09-10T01:20:20.000Z","dependencies_parsed_at":"2024-01-13T12:11:40.432Z","dependency_job_id":"df25eb57-dd3d-4d6f-8825-b6c041ff4056","html_url":"https://github.com/Berrysoft/fallback","commit_stats":{"total_commits":4,"total_committers":1,"mean_commits":4.0,"dds":0.0,"last_synced_commit":"b3845fee0cf17a403662274089555bec7767ee34"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Berrysoft/fallback","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Berrysoft%2Ffallback","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Berrysoft%2Ffallback/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Berrysoft%2Ffallback/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Berrysoft%2Ffallback/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Berrysoft","download_url":"https://codeload.github.com/Berrysoft/fallback/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Berrysoft%2Ffallback/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279015087,"owners_count":26085644,"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-10-13T02:00:06.723Z","response_time":61,"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":[],"created_at":"2025-10-13T12:52:01.073Z","updated_at":"2025-10-13T12:52:02.507Z","avatar_url":"https://github.com/Berrysoft.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# fallback\n\nThis is a helper library to implement fallback mechaism.\nIt contains two `Option`, and if the \"desired\" one is `None`, the \"base\" one will be chosen.\n\nA trait called `FallbackSpec` is used to implement field fallback for a struct.\n\n``` rust\nuse fallback::*;\n\n#[derive(FallbackSpec)]\nstruct Foo {\n    data1: i32,\n    data2: String,\n}\n\nlet data = Foo {\n    data1: 123,\n    data2: \"Hello\".to_string(),\n};\n\nlet data = Fallback::new(None, Some(data));\nlet data = data.spec();\n\nassert_eq!(data.data1.unzip(), (None, Some(123)));\nassert_eq!(data.data2.unzip(), (None, Some(\"Hello\".to_string())));\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fberrysoft%2Ffallback","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fberrysoft%2Ffallback","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fberrysoft%2Ffallback/lists"}