โ— Shell
clean mode source โ†—

rustpython_vm::pyobject::PyRef - Rust

[โˆ’][src]Struct rustpython_vm::pyobject::PyRef

A reference to a Python object.

Note that a PyRef<T> can only deref to a shared / immutable reference. It is the payload type's responsibility to handle (possibly concurrent) mutability with locks or concurrent data structures if required.

A PyRef<T> can be directly returned from a built-in function to handle situations (such as when implementing in-place methods such as __iadd__) where a reference to the same object must be returned.

impl<T: PyValue> PyRef<T>[src]

pub fn as_object(&self) -> &PyObjectRef[src]

pub fn into_object(self) -> PyObjectRef[src]

pub fn typ(&self) -> PyClassRef[src]

impl<T> Clone for PyRef<T>[src]

impl<T: Debug> Debug for PyRef<T>[src]

impl<T> Deref for PyRef<T> where
    T: PyValue
[src]

type Target = T

The resulting type after dereferencing.

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

Dereferences the value.

impl<T: Display> Display for PyRef<T> where
    T: PyValue + Display
[src]

impl<'a, T: PyValue> From<&'a PyRef<T>> for &'a PyObjectRef[src]

impl From<PyRef<PyBaseException>> for ArgumentError[src]

impl<T: PyValue> From<PyRef<T>> for PyObjectRef[src]

impl<T: PyObjectPayload> IdProtocol for PyRef<T>[src]

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

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

impl<T> IntoPyObject for PyRef<T>[src]

fn into_pyobject(self, _vm: &VirtualMachine) -> PyResult[src]

impl<T> PyClassDef for PyRef<T> where
    T: PyClassDef
[src]

const NAME: &'static str[src]

const DOC: Option<&'static str>[src]

impl PyClassImpl for PyRef<Frame>[src]

const TP_FLAGS: PyTpFlags[src]

fn impl_extend_class(ctx: &PyContext, class: &PyClassRef)[src]

fn extend_class(ctx: &PyContext, class: &PyClassRef)[src]

fn make_class(ctx: &PyContext) -> PyClassRef[src]

fn make_class_with_base(ctx: &PyContext, base: PyClassRef) -> PyClassRef[src]

impl<T> TryFromObject for PyRef<T> where
    T: PyValue
[src]

impl<T> TryIntoRef<T> for PyRef<T>[src]

fn try_into_ref(self, _vm: &VirtualMachine) -> PyResult<PyRef<T>>[src]

impl<T> TypeProtocol for PyRef<T>[src]

fn class(&self) -> PyClassRef[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> FromArgs for T where
    T: TryFromObject
[src]

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

fn into(self) -> U[src]

Performs the conversion.

impl<I> IntoIterator for I where
    I: Iterator
[src]

impl<T> IntoPyObject for T where
    T: PyValue
[src]

fn into_pyobject(
    Self,
    &VirtualMachine
) -> Result<Rc<PyObject<dyn PyObjectPayload + 'static>>, PyRef<PyBaseException>>
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T> ToOwned for T where
    T: Clone
[src]

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