Registry / utility / downcast-rs

downcast-rs

JSON →
library2.0.2rscratesunverified

Provides safe trait object downcasting with support for type parameters, associated types, and type constraints.

utility
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.

use downcast_rs::Downcast;

Downcasts a trait object to a concrete type.

use downcast_rs::Downcast; trait MyTrait: Downcast {} impl_downcast!(MyTrait); struct MyStruct; impl MyTrait for MyStruct {} fn main() { let obj: Box<dyn MyTrait> = Box::new(MyStruct); if let Some(concrete) = obj.downcast_ref::<MyStruct>() { println!("Downcast succeeded"); } }
Debug
Known footguns

No known footguns recorded.

Upgrade
Version history

Breaking-change detection hasn't run for this library yet.

Audit
Security & dependencies

CVE tracking and dependency tree are planned for a later release.

Agent activity
11 hits · last 30 days
gptbot
3
claudebot
3
Resources