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::PyRef - Rust

[−][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]

fn clone(&self) -> Self[src]

Returns a copy of the value. Read more

fn clone_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

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

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

Formats the value using the given formatter. Read more

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]

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

Formats the value using the given formatter. Read more

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

fn from(obj: &'a PyRef<T>) -> Self[src]

Performs the conversion.

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

fn from(ex: PyBaseExceptionRef) -> Self[src]

Performs the conversion.

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

fn from(obj: PyRef<T>) -> Self[src]

Performs the conversion.

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]

fn try_from_object(vm: &VirtualMachine, obj: PyObjectRef) -> PyResult<Self>[src]

Attempt to convert a Python object to a value of this type.

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]

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]

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> FromArgs for T where
    T: TryFromObject, 
[src]

fn arity() -> RangeInclusive<usize>[src]

The range of positional arguments permitted by the function signature. Read more

fn from_args(&VirtualMachine, &mut PyFuncArgs) -> Result<T, ArgumentError>[src]

Extracts this item from the next argument(s).

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]

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?

fn into_iter(self) -> I[src]

Creates an iterator from a value. Read more

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]

type Owned = T

The resulting type after obtaining ownership.

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

Creates owned data from borrowed data, usually by cloning. Read more

fn clone_into(&self, target: &mut T)[src]

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

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 01402520 — 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.