◐ Shell
clean mode source ↗

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]

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]

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]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

fn from(t: T) -> T[src]

Performs the conversion.

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

fn into(self) -> U[src]

Performs the conversion.

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

impl<V, T> VZip<V> for T where
    V: MultiLane<T>, 

fn vzip(self) -> V