[][src]Struct rustpython_vm::pyobject::PyRef

pub struct PyRef<T> { /* fields omitted */ }

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.

Methods

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]

Trait Implementations

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.

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]

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

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

impl PyClassImpl for PyRef<Frame>[src]

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

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

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

Auto Trait Implementations

impl<T> !RefUnwindSafe for PyRef<T>

impl<T> !Send for PyRef<T>

impl<T> !Sync for PyRef<T>

impl<T> Unpin for PyRef<T> where
    T: Unpin

impl<T> !UnwindSafe for PyRef<T>

Blanket Implementations

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]

impl<T> FromArgs for T where
    T: TryFromObject
[src]

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

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

type Item = <I as Iterator>::Item

The type of the elements being iterated over.

type IntoIter = I

Which kind of iterator are we turning this into?

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

impl<T> Same<T> for T

type Output = T

Should always be Self

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

type Owned = T

The resulting type after obtaining ownership.

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

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.

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.

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