pub trait PyTypeCheck {
const NAME: &'static str;
// Required method
fn type_check(object: &Bound<'_, PyAny>) -> bool;
}
Expand description
Implemented by types which can be used as a concrete Python type inside Py<T>
smart pointers.
Required Associated Constants§
Required Methods§
Sourcefn type_check(object: &Bound<'_, PyAny>) -> bool
fn type_check(object: &Bound<'_, PyAny>) -> bool
Checks if object
is an instance of Self
, which may include a subtype.
This should be equivalent to the Python expression isinstance(object, Self)
.
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.