You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Felix Köpge 0626e7ba02 Initial commit 2 years ago
examples Initial commit 2 years ago
src Initial commit 2 years ago
.gitattributes Initial commit 2 years ago
.gitignore Initial commit 2 years ago
Cargo.toml Initial commit 2 years ago
LICENSE-MIT Initial commit 2 years ago
README.md Initial commit 2 years ago
clippy.toml Initial commit 2 years ago
rustfmt.toml Initial commit 2 years ago

README.md

downcast

A trait (& utilities) for downcasting trait objects back to their original values.

example usage

Add to your Cargo.toml:

[dependencies]
downcast = "*"

Add to your crate root:

#[macro_use]
extern crate downcast;
  • simple showcases the most simple usage of this library.
  • with_params showcases how to deal with traits who have type parameters.
  • downcasted showcases how to use the Downcasted wrapper types.

build features

  • std (default) enables us all functionality requiring the standard library (Downcast::downcast()).
  • nightly enables us all functionality requiring rust nightly (Any::type_name(), Downcasted::try_from()).

contribution guidelines

Make sure to cargo install rustfmt and cargo fmt the codebase before creating any commits!