{"id":15529975,"url":"https://github.com/snsvrno/result-hx","last_synced_at":"2026-02-06T06:03:14.500Z","repository":{"id":137809946,"uuid":"477751320","full_name":"snsvrno/result-hx","owner":"snsvrno","description":"Simple safe return type library","archived":false,"fork":false,"pushed_at":"2023-06-08T22:28:53.000Z","size":283,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-07-25T21:11:41.505Z","etag":null,"topics":["haxe","library"],"latest_commit_sha":null,"homepage":"https://snsvrno.github.io/result-hx/","language":"Haxe","has_issues":false,"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/snsvrno.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,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-04-04T15:02:17.000Z","updated_at":"2024-04-02T17:41:49.000Z","dependencies_parsed_at":"2024-01-27T08:45:07.826Z","dependency_job_id":null,"html_url":"https://github.com/snsvrno/result-hx","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/snsvrno/result-hx","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/snsvrno%2Fresult-hx","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/snsvrno%2Fresult-hx/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/snsvrno%2Fresult-hx/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/snsvrno%2Fresult-hx/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/snsvrno","download_url":"https://codeload.github.com/snsvrno/result-hx/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/snsvrno%2Fresult-hx/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29153145,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-06T02:39:25.012Z","status":"ssl_error","status_checked_at":"2026-02-06T02:37:22.784Z","response_time":59,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["haxe","library"],"created_at":"2024-10-02T11:20:38.282Z","updated_at":"2026-02-06T06:03:14.478Z","avatar_url":"https://github.com/snsvrno.png","language":"Haxe","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Result.hx\nA simple return object based on Rust's [Result](https://doc.rust-lang.org/std/result/enum.Result.html) for easier error handling and making safe code easier.\n\n## Usage\n**Result-hx** was created to allow for \"safer\" returning of functions, and better management of errors. `Result\u003cT,E\u003e` has two type parameters, `T` is the main return type while `E` is the error type.\n\n```haxe\nimport result.Result;\n\nfunction getContent(file : String) : Result\u003cString, String\u003e {\n\tif (!sys.FileSystem.exists(file)) return Error('file $file does not exist');\n\telse return Ok(sys.io.File.getContent(file));\n}\n\nfunction main() {\n\tswitch(getContent(\"afile.txt\")) {\n\t\tcase Error(error): Sys.println('error getting content: $error');\n\t\tcase Ok(content): Sys.println('file content: $content');\n\t}\n}\n```\n\nSome helper functions are included in `result.ResultTools`\n\n```haxe\nusing result.ResultTools;\n\nfunction main() {\n\tvar content = getContent(\"afile.txt\");\n\n\ttrace(content.isOk());\n\n\tSys.println('file content: ${content.unwrap()}');\n\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsnsvrno%2Fresult-hx","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsnsvrno%2Fresult-hx","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsnsvrno%2Fresult-hx/lists"}