Trait rustpython_vm::object::AsObject
source · pub trait AsObject{
// Provided methods
fn as_object(&self) -> &PyObject { ... }
fn get_id(&self) -> usize { ... }
fn is<T>(&self, other: &T) -> bool
where T: AsObject { ... }
fn class(&self) -> &Py<PyType> { ... }
fn get_class_attr(
&self,
attr_name: &'static PyStrInterned
) -> Option<PyObjectRef> { ... }
fn fast_isinstance(&self, cls: &Py<PyType>) -> bool { ... }
}Provided Methods§
fn as_object(&self) -> &PyObject
fn get_id(&self) -> usize
fn is<T>(&self, other: &T) -> boolwhere
T: AsObject,
fn class(&self) -> &Py<PyType>
fn get_class_attr( &self, attr_name: &'static PyStrInterned ) -> Option<PyObjectRef>
sourcefn fast_isinstance(&self, cls: &Py<PyType>) -> bool
fn fast_isinstance(&self, cls: &Py<PyType>) -> bool
Determines if obj actually an instance of cls, this doesn’t call instancecheck, so only
use this if cls is known to have not overridden the base instancecheck magic method.
Object Safety§
This trait is not object safe.