use kdb::{cast, try_cast, Any, Atom, KBox}; fn main() { let int = KBox::new_atom(42); // convert to an "any" value: let any: KBox = int.into(); // convert back to an i32 atom. let int = cast!(any; Atom); println!("{:?}", int); let any: KBox = int.into(); // try to convert to a u8 atom. This will fail! if let Err(e) = try_cast!(any; Atom) { println!("Error: {}", e); } }