Trait Cast
pub trait Cast: SystemObject {
// Provided methods
fn get_class(self) -> Class { ... }
fn is_null(self) -> bool { ... }
fn rebind_class(self, new_class: Class) { ... }
fn override_class(self) -> Class { ... }
fn is_instance_of<T>(self) -> bool
where T: ClassIdentity { ... }
fn is_direct_subclass_of<T>(self) -> bool
where T: ClassIdentity { ... }
fn try_cast<T>(self) -> Option<T>
where T: ClassIdentity + FromIlInstance { ... }
unsafe fn cast<T>(self) -> T
where T: ClassIdentity + FromIlInstance { ... }
}Provided Methods§
fn get_class(self) -> Class
fn is_null(self) -> bool
fn rebind_class(self, new_class: Class)
fn override_class(self) -> Class
fn is_instance_of<T>(self) -> boolwhere
T: ClassIdentity,
fn is_direct_subclass_of<T>(self) -> boolwhere
T: ClassIdentity,
fn try_cast<T>(self) -> Option<T>where
T: ClassIdentity + FromIlInstance,
unsafe fn cast<T>(self) -> Twhere
T: ClassIdentity + FromIlInstance,
unsafe fn cast<T>(self) -> Twhere
T: ClassIdentity + FromIlInstance,
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.