{"id":17126420,"url":"https://github.com/kellpossible/rustytypes","last_synced_at":"2025-09-14T15:30:09.529Z","repository":{"id":71253199,"uuid":"148660021","full_name":"kellpossible/RustyTypes","owner":"kellpossible","description":"Java types inspired by the Rust programming language","archived":false,"fork":false,"pushed_at":"2018-09-13T16:11:27.000Z","size":54,"stargazers_count":0,"open_issues_count":4,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-24T03:47:09.131Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Java","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/kellpossible.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":"2018-09-13T15:38:52.000Z","updated_at":"2018-09-13T16:11:29.000Z","dependencies_parsed_at":"2023-05-18T23:00:20.111Z","dependency_job_id":null,"html_url":"https://github.com/kellpossible/RustyTypes","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/kellpossible/RustyTypes","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kellpossible%2FRustyTypes","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kellpossible%2FRustyTypes/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kellpossible%2FRustyTypes/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kellpossible%2FRustyTypes/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kellpossible","download_url":"https://codeload.github.com/kellpossible/RustyTypes/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kellpossible%2FRustyTypes/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261715082,"owners_count":23198703,"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-14T18:47:57.018Z","updated_at":"2025-06-24T16:36:04.862Z","avatar_url":"https://github.com/kellpossible.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# RustyTypes for Java\n\nThis project is a collection of Java types which are inspired by the Rust programming language. \n\n## Types\n\n### [Result](src/main/java/org/kellpossible/rustytypes/Result.java)\n\nThis type is inspired by [Rust's Result enum](https://doc.rust-lang.org/std/result/).\n\nA `Result` method can be created by using its static constructor methods `ofValue()` or `ofError()` to create a result which contains either a result value or an error. \n\n```java\nResult\u003cValueType, ErrorType\u003e resultWithValue = Result.ofValue(value);\nResult\u003cValueType, ErrorType\u003e resultWithError = Result.ofError(error);\n```\n\nThe only way to access the value inside the `Result` is to use the `handle()` method. This method has two overloaded implementations. One makes use of lambdas, and the other uses the `ResultHandler` interface along with its two methods. This method forces consumers of the `Result` to consider the implications of either a value being present or an error being present.\n\n```java\nresult.handle(\n        value -\u003e {\n            // handle what happens if the result contains a value\n        },\n        error -\u003e {\n            // handle what happens if the result contains an error\n        }\n);\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkellpossible%2Frustytypes","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkellpossible%2Frustytypes","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkellpossible%2Frustytypes/lists"}