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]
T: PyValue,
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]
T: PyValue + Display,
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]
T: IdProtocol,
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]
T: PyClassDef,
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]
T: PyValue,
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]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized, [src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]
T: ?Sized,
impl<T> From<T> for T[src]
impl<T> FromArgs for T where
T: TryFromObject, [src]
T: TryFromObject,
impl<T, U> Into<U> for T where
U: From<T>, [src]
U: From<T>,
impl<I> IntoIterator for I where
I: Iterator, [src]
I: Iterator,
impl<T> IntoPyObject for T where
T: PyValue, [src]
T: PyValue,
fn into_pyobject(
Self,
&VirtualMachine
) -> Result<Rc<PyObject<dyn PyObjectPayload + 'static>>, PyRef<PyBaseException>>[src]
Self,
&VirtualMachine
) -> Result<Rc<PyObject<dyn PyObjectPayload + 'static>>, PyRef<PyBaseException>>
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<T> ToOwned for T where
T: Clone, [src]
T: Clone,
impl<T> ToString for T where
T: Display + ?Sized, [src]
T: Display + ?Sized,
impl<T, U> TryFrom<U> for T where
U: Into<T>, [src]
U: Into<T>,
impl<T, U> TryInto<U> for T where
U: TryFrom<T>, [src]
U: TryFrom<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,