1 2 3 4 5 6 7 8 9 10 11
use super::*; pub trait Cast { fn cast<T: JsCast>(self) -> T; } impl<V: JsCast + std::fmt::Debug> Cast for V { fn cast<T: JsCast>(self) -> T { self.dyn_into::<T>().expect("cast failed") } }