GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • rustpython_vm
  • pyobject

This view

  • Original page
  • New address

GeezerVison is showing rustpython.github.io — rustpython_vm::pyobject::PyObject - Rust

[−][src]Struct rustpython_vm::pyobject::PyObject

pub struct PyObject<T: ?Sized> where
    T: PyObjectPayload, 
{ pub typ: PyClassRef, pub dict: Option<RefCell<PyDictRef>>, pub payload: T, }

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.

Fields

typ: PyClassRefdict: Option<RefCell<PyDictRef>>payload: T

Methods

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]

Trait Implementations

impl Debug for PyObject<dyn PyObjectPayload>[src]

fn fmt(&self, f: &mut Formatter) -> Result[src]

Formats the value using the given formatter. Read more

impl Display for PyObject<dyn PyObjectPayload>[src]

fn fmt(&self, f: &mut Formatter) -> Result[src]

Formats the value using the given formatter. Read more

impl<T: ?Sized + PyObjectPayload> IdProtocol for PyObject<T>[src]

fn get_id(&self) -> usize[src]

fn is<T>(&self, other: &T) -> bool where
    T: IdProtocol, 
[src]

impl<T: ?Sized> TypeProtocol for PyObject<T> where
    T: PyObjectPayload, 
[src]

fn class(&self) -> PyClassRef[src]

Auto Trait Implementations

impl<T> !RefUnwindSafe for PyObject<T>

impl<T> !Send for PyObject<T>

impl<T> !Sync for PyObject<T>

impl<T: ?Sized> Unpin for PyObject<T> where
    T: Unpin, 

impl<T> !UnwindSafe for PyObject<T>

Blanket Implementations

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

fn type_id(&self) -> TypeId[src]

Gets the TypeId of self. Read more

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

fn borrow(&self) -> &T[src]

Immutably borrows from an owned value. Read more

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

fn borrow_mut(&mut self) -> &mut T[src]

Mutably borrows from an owned value. Read more

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]

default fn to_string(&self) -> String[src]

Converts the given value to a String. Read more

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

type Error = Infallible

The type returned in the event of a conversion error.

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]

Performs the conversion.

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

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]

Performs the conversion.

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

fn vzip(self) -> V

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.