Crates.io | enumcapsulate |
lib.rs | enumcapsulate |
version | |
source | src |
created_at | 2024-01-22 17:42:50.585412 |
updated_at | 2024-12-01 01:09:00.048404 |
description | Safe casting for newtype enums and their variants |
homepage | https://github.com/regexident/enumcapsulate |
repository | https://github.com/regexident/enumcapsulate |
max_upload_size | |
id | 1109029 |
Cargo.toml error: | TOML parse error at line 18, column 1 | 18 | autolib = false | ^^^^^^^ unknown field `autolib`, expected one of `name`, `version`, `edition`, `authors`, `description`, `readme`, `license`, `repository`, `homepage`, `documentation`, `build`, `resolver`, `links`, `default-run`, `default_dash_run`, `rust-version`, `rust_dash_version`, `rust_version`, `license-file`, `license_dash_file`, `license_file`, `licenseFile`, `license_capital_file`, `forced-target`, `forced_dash_target`, `autobins`, `autotests`, `autoexamples`, `autobenches`, `publish`, `metadata`, `keywords`, `categories`, `exclude`, `include` |
size | 0 |
enumcapsulate
Safe casting for newtype enums and their variants.
The enumcapsulate
crate exports the following traits:
Traits | Functionality |
---|---|
Encapsulate |
Umbrella derive macro for AsVariant , AsVariantMut , AsVariantRef , From , FromVariant , IntoVariant , TryInto , and VariantDowncast . |
FromVariant |
Creates an instance of Self from the unambiguous field type of one of its variants. |
IntoVariant |
Returns the current variant's field, consuming self . |
AsVariant |
Provides owned access to the current variant's field. |
AsVariantMut |
Provides mutable borrowed access to the current variant's field. |
AsVariantRef |
Provides borrowed access to the current variant's field. |
VariantDowncast |
Convenience umbrella trait utilizing AsVariant , AsVariantRef , AsVariantMut , and IntoVariant . |
VariantDiscriminant |
Used to obtain an enum variant's discriminant. |
The enumcapsulate
crate exports the following corresponding derive macros, if the "derive"
feature is enabled (which is the default):
Encapsulate
From
TryInto
FromVariant
IntoVariant
AsVariant
AsVariantMut
AsVariantRef
VariantDowncast
VariantDiscriminant
Please refer to the documentation on docs.rs.
Please read CONTRIBUTING.md for details on our code of conduct,
and the process for submitting pull requests to us.
We use SemVer for versioning. For the versions available, see the tags on this repository.
This project is licensed under the MPL-2.0 – see the LICENSE.md file for details.