{"id":15936027,"url":"https://github.com/zephraph/rust-types","last_synced_at":"2025-02-23T04:18:38.226Z","repository":{"id":228647100,"uuid":"774563179","full_name":"zephraph/rust-types","owner":"zephraph","description":"Rust types for TypeScript","archived":false,"fork":false,"pushed_at":"2024-06-15T23:04:02.000Z","size":6,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-01-04T07:25:37.929Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","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/zephraph.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":"2024-03-19T19:10:32.000Z","updated_at":"2024-06-15T23:04:05.000Z","dependencies_parsed_at":"2024-03-19T20:43:56.477Z","dependency_job_id":null,"html_url":"https://github.com/zephraph/rust-types","commit_stats":null,"previous_names":["membrane-io/rust-types","zephraph/rust-types"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zephraph%2Frust-types","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zephraph%2Frust-types/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zephraph%2Frust-types/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zephraph%2Frust-types/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zephraph","download_url":"https://codeload.github.com/zephraph/rust-types/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240267333,"owners_count":19774167,"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-07T04:03:23.445Z","updated_at":"2025-02-23T04:18:38.206Z","avatar_url":"https://github.com/zephraph.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# @justbe/rust-types\n\nRust inspired types for TypeScript.\n\n## Examples\n\n### Result type\n\n```ts\nimport { Result } from \"@justbe/rust-types\";\n\n// Use `Result.ok` to construct an OK type\nconst ok = Result.ok(\"this works\");\n\n// Use `Result.err` to construct an Error type\nconst err = Result.err(new Error(\"something went wrong!\"));\n\n/// Safely coerce the results of a promise into a result type\nconst promiseResult = await Result.fromPromise(myPromise);\n\n// `isErr` or `isOk` can be used to check the kind of result\nif (promiseResult.isErr()) {\n  // handle your error...\n}\n\n// Use `unwrap` to get the value of the result. Throws if the result is an error.\nconst myValue = promiseResult.unwrap();\n```\n\n### Option type\n\n```ts\nimport { Option } from \"@justbe/rust-types\";\n\n// Use `Option.some` to construct a `Some` type\nconst some = Option.some(\"value\");\n\n// Use `Option.none` to construct a `None` type\nconst none = Option.none();\n\n// Construct an option from a type that might be `null` or `undefined`\nconst optionalValue = Option.from(someValue);\n\n// `isSome` or `isNone` can be used to check the state of the value\nif (optionalValue.isNone()) {\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzephraph%2Frust-types","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzephraph%2Frust-types","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzephraph%2Frust-types/lists"}