-
cargo add dyn_safe
, or add the following to yourCargo.toml
file:[dependencies] dyn_safe = "x.y.z"
- where you can find the version using
cargo search dyn_safe
- where you can find the version using
-
Add the following to your
lib.rs
file:#[macro_use] extern crate dyn_safe;
-
Use
#[dyn_safe(true)]
or#[dyn_safe(false)]
to, respectively, assert that the trait object isdyn
-safe or that the trait object should not bedyn
-safe.-
#[macro_use] extern crate dyn_safe; #[dyn_safe(true)] trait Foo { fn whoops (); }
-
#[macro_use] extern crate dyn_safe; #[dyn_safe(false)] trait Foo { // … } let _: dyn Foo; // Whoops
-
-
Notifications
You must be signed in to change notification settings - Fork 1
Take control of the Semver hazard of the `dyn` safety of your traits!
License
Apache-2.0 and 2 other licenses found
Licenses found
Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT
Zlib
LICENSE-ZLIB
danielhenrymantilla/dyn_safe.rs
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
About
Take control of the Semver hazard of the `dyn` safety of your traits!
Resources
License
Apache-2.0 and 2 other licenses found
Licenses found
Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT
Zlib
LICENSE-ZLIB
Stars
Watchers
Forks
Packages 0
No packages published