{"id":51457652,"url":"https://github.com/nekitdev/refining","last_synced_at":"2026-07-06T02:01:14.887Z","repository":{"id":279939706,"uuid":"938862798","full_name":"nekitdev/refining","owner":"nekitdev","description":"Refinement types.","archived":false,"fork":false,"pushed_at":"2026-06-19T14:31:51.000Z","size":72,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-06-19T16:25:39.869Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://docs.rs/refining","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/nekitdev.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null},"funding":{"github":["nekitdev"],"custom":"https://nekit.dev/funding"}},"created_at":"2025-02-25T16:10:48.000Z","updated_at":"2026-06-19T14:31:40.000Z","dependencies_parsed_at":null,"dependency_job_id":"47e1c1c3-ecda-4f1c-8c4b-db8660f63622","html_url":"https://github.com/nekitdev/refining","commit_stats":null,"previous_names":["nekitdev/refinement-types","nekitdev/refining"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/nekitdev/refining","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nekitdev%2Frefining","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nekitdev%2Frefining/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nekitdev%2Frefining/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nekitdev%2Frefining/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nekitdev","download_url":"https://codeload.github.com/nekitdev/refining/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nekitdev%2Frefining/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":35175119,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-07-06T02:00:07.184Z","response_time":106,"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":"2026-07-06T02:01:14.062Z","updated_at":"2026-07-06T02:01:14.862Z","avatar_url":"https://github.com/nekitdev.png","language":"Rust","funding_links":["https://github.com/sponsors/nekitdev","https://nekit.dev/funding"],"categories":[],"sub_categories":[],"readme":"# `refining`\n\n[![License][License Badge]][License]\n[![Version][Version Badge]][Crate]\n[![Downloads][Downloads Badge]][Crate]\n[![Test][Test Badge]][Actions]\n\n\u003e *Refinement types.*\n\n## Installation\n\n### `cargo`\n\nYou can add `refining` as a dependency with the following command:\n\n```console\n$ cargo add refining\n```\n\nOr by directly specifying it in the configuration like so:\n\n```toml\n[dependencies]\nrefining = \"0.3.0\"\n```\n\nAlternatively, you can add it directly from the source:\n\n```toml\n[dependencies.refining]\ngit = \"https://github.com/nekitdev/refining.git\"\n```\n\n## Examples\n\n```rust\nuse core::fmt;\n\nuse anyhow::Result;\n\nuse refining::prelude::*;\n\ntype_str!(DeviceName = \"device name\");\ntype_str!(DeviceCharge = \"device charge\");\n\ntype Name = Refinement\u003cstr, And\u003cAscii, LengthClosed\u003c1, 32\u003e\u003e, DeviceName\u003e;\ntype Charge = Refinement\u003cu8, u8::Closed\u003c1, 100\u003e, DeviceCharge\u003e;\n\nstruct Device\u003c'a\u003e {\n    name: \u0026'a Name,\n    charge: Charge,\n}\n\nimpl fmt::Display for Device\u003c'_\u003e {\n    fn fmt(\u0026self, formatter: \u0026mut fmt::Formatter\u003c'_\u003e) -\u003e fmt::Result {\n        write!(\n            formatter,\n            \"{name} ({charge}%)\",\n            name = self.name,\n            charge = self.charge\n        )\n    }\n}\n\nfn main() -\u003e Result\u003c()\u003e {\n    let name = \"nekit\".refine_ref()?;\n    let charge = 42.refine()?;\n\n    let device = Device { name, charge };\n\n    println!(\"{device}\");\n\n    Ok(())\n}\n```\n\nRunning the example will print the following output:\n\n```text\nnekit (42%)\n```\n\n## Features\n\nThe `refining` crate comes with the following features:\n\n- `std` (*enabled by default*): depends on the Rust Standard Library (`std`);\n- `empty` (*enabled by default*): provides [`refining::empty`][refining-empty] predicates;\n- `length` (*enabled by default*): provides [`refining::length`][refining-length] predicates;\n- `int` (*enabled by default*): provides [`refining::int`][refining-int] predicates;\n- `char` (*enabled by default*): provides [`refining::char`][refining-char] predicates;\n- `str` (*enabled by default*): provides [`refining::str`][refining-str] predicates;\n- `regex` (*enabled by default*, implies `std`): provides [`refining::regex`][refining-regex] predicates;\n- `serde` (*enabled by default*): implements `Serialize` and `Deserialize` for `Refinement` types;\n- `unsafe-assert`: adds `assert_unchecked` calls to `get` and `get_ref` of `Refinement` types;\n- `alloc`: depends on the `alloc` crate, providing support for heap-allocated types in `no_std` environments.\n\nThe default features can be disabled via the following:\n\n```toml\n[dependencies.refining]\nversion = \"0.3.0\"\ndefault-features = false\n```\n\nThen only the [`refining::core`][refining-core] module will be available; additional features\ncan be enabled individually.\n\nAgain, note that `regex` implies `std`, so it can not be used in `no_std` environments.\n\n## Documentation\n\nYou can find the documentation [here][Documentation].\n\n## Support\n\nIf you need support with the library, you can send an [email][Email].\n\n## Changelog\n\nYou can find the changelog [here][Changelog].\n\n## Security Policy\n\nYou can find the Security Policy of `refining` [here][Security].\n\n## Contributing\n\nIf you are interested in contributing to `refining`, make sure to take a look at the\n[Contributing Guide][Contributing Guide], as well as the [Code of Conduct][Code of Conduct].\n\n## License\n\n`refining` is licensed under the MIT License terms. See [License][License] for details.\n\n[Email]: mailto:support@nekit.dev\n\n[Discord]: https://nekit.dev/chat\n\n[Actions]: https://github.com/nekitdev/refining/actions\n\n[Changelog]: https://github.com/nekitdev/refining/blob/main/CHANGELOG.md\n[Code of Conduct]: https://github.com/nekitdev/refining/blob/main/CODE_OF_CONDUCT.md\n[Contributing Guide]: https://github.com/nekitdev/refining/blob/main/CONTRIBUTING.md\n[Security]: https://github.com/nekitdev/refining/blob/main/SECURITY.md\n\n[License]: https://github.com/nekitdev/refining/blob/main/LICENSE\n\n[Crate]: https://crates.io/crates/refining\n[Documentation]: https://docs.rs/refining\n\n[License Badge]: https://img.shields.io/crates/l/refining\n[Version Badge]: https://img.shields.io/crates/v/refining\n[Downloads Badge]: https://img.shields.io/crates/dr/refining\n[Test Badge]: https://github.com/nekitdev/refining/workflows/test/badge.svg\n\n[refining-core]: https://docs.rs/refining-core\n[refining-empty]: https://docs.rs/refining-empty\n[refining-length]: https://docs.rs/refining-length\n[refining-int]: https://docs.rs/refining-int\n[refining-char]: https://docs.rs/refining-char\n[refining-str]: https://docs.rs/refining-str\n[refining-regex]: https://docs.rs/refining-regex\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnekitdev%2Frefining","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnekitdev%2Frefining","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnekitdev%2Frefining/lists"}