rustpython_vm::pyobject::PyObject - Rust
This is an actual python object. It consists of a typ which is the
python class, and carries some rust payload optionally. This rust
payload can be a rust float or rust int in case of float and int objects.
impl PyObject<dyn PyObjectPayload>[src]
pub fn downcast<T: PyObjectPayload>(
self: Rc<Self>
) -> Result<PyRef<T>, PyObjectRef>[src]
self: Rc<Self>
) -> Result<PyRef<T>, PyObjectRef>
Attempt to downcast this reference to a subclass.
If the downcast fails, the original ref is returned in as Err so
another downcast can be attempted without unnecessary cloning.
impl<T> PyObject<T> where
T: Sized + PyObjectPayload, [src]
T: Sized + PyObjectPayload,
pub fn new(payload: T, typ: PyClassRef, dict: Option<PyDictRef>) -> PyObjectRef[src]
pub fn into_ref(self) -> PyObjectRef[src]
impl PyObject<dyn PyObjectPayload>[src]
pub fn payload<T: PyObjectPayload>(&self) -> Option<&T>[src]
pub fn payload_is<T: PyObjectPayload>(&self) -> bool[src]
pub fn payload_if_subclass<T: PyObjectPayload + PyValue>(
&self,
vm: &VirtualMachine
) -> Option<&T>[src]
&self,
vm: &VirtualMachine
) -> Option<&T>
impl<T> Any for T where
T: 'static + ?Sized, [src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized, [src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]
T: ?Sized,
impl<T> From<T> for T[src]
impl<T, U> Into<U> for T where
U: From<T>, [src]
U: From<T>,
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<T> ToString for T where
T: Display + ?Sized, [src]
T: Display + ?Sized,
impl<T, U> TryFrom<U> for T where
U: Into<T>, [src]
U: Into<T>,
impl<T, U> TryInto<U> for T where
U: TryFrom<T>, [src]
U: TryFrom<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,