GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - regexident/enumcapsulate: Safe casting for newtype enums and their variants

BranchesTags
Open more actions menu

Latest commit

 

History

171 Commits
171 Commits

Folders and files

NameName
Last commit message
Last commit date
.cargo
.cargo
 
 
.github/workflows
.github/workflows
 
 
macros
macros
 
 
src
src
 
 
tests
tests
 
 
.gitignore
.gitignore
 
 
CHANGELOG.md
CHANGELOG.md
 
 
CONTRIBUTING.md
CONTRIBUTING.md
 
 
Cargo.toml
Cargo.toml
 
 
LICENSE.md
LICENSE.md
 
 
README.md
README.md
 
 
renovate.json
renovate.json
 
 

Repository files navigation

enumcapsulate

Crates.io Crates.io Crates.io docs.rs

Safe casting for newtype enums and their variants.


Traits

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.

Derive macros

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

Find more information on above derive macros in enumcapsulate-macros's own README file.

Documentation

Please refer to the documentation on docs.rs.

Contributing

Please read CONTRIBUTING.md for details on our code of conduct,
and the process for submitting pull requests to us.

Versioning

We use SemVer for versioning. For the versions available, see the tags on this repository.

License

This project is licensed under the MPL-2.0 – see the LICENSE.md file for details.

About

Safe casting for newtype enums and their variants

Resources

Readme
MPL-2.0 license

Contributing

Contributing
Activity

Stars

3 stars

Watchers

1 watching

Forks

1 fork
Report repository

Releases

Packages

Used by

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.