Registry / utility / mopa
library0.2.2rscratesunverified

My Own Personal Any: provides a custom Any trait with additional functionality like downcasting.

# Cargo.toml [dependencies] mopa = "0.2.2"
INSTALL
IMPORT
SIG · MOPA
M
mopa
utilityrustv0.2.2
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

Any
use mopa::Any;

Downcasts a boxed trait object to a concrete type.

use mopa::Any; fn main() { let value: Box<dyn Any> = Box::new(42u32); if let Some(num) = value.downcast_ref::<u32>() { println!("Number: {}", num); } }
Debug
Known issues
gotchaThis crate is largely superseded by std::any::Any in modern Rust.
fix
Consider using std::any::Any directly unless you need extra features.
affects: >=0.1.0
Upgrade
Version history
0.2.2latest on crates.io
Audit
Dependencies

No dependency data recorded yet.

Agent activity
4 hits · last 30 days
node
4
Resources
mopa — cargo add mopa · libregistry