Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- use std::any::Any;
- pub type Body = Box<dyn Any + Send + Sync + 'static>;
- fn main() {
- let x: Body = Box::new(42u32);
- println!("Hello, world {}!", x.downcast::<u32>().unwrap());
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement