[−][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.
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]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl<T: Debug> Debug for PyRef<T>
[src]
impl<T> Deref for PyRef<T> where
T: PyValue,
[src]
T: PyValue,
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]
fn from(ex: PyBaseExceptionRef) -> Self
[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]
fn into_pyobject(self, _vm: &VirtualMachine) -> PyResult
[src]
impl<T> PyClassDef for PyRef<T> where
T: PyClassDef,
[src]
T: PyClassDef,
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,
fn try_from_object(vm: &VirtualMachine, obj: PyObjectRef) -> PyResult<Self>
[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]
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,
T: Unpin,
impl<T> !UnwindSafe for PyRef<T>
Blanket Implementations
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,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T> FromArgs for T where
T: TryFromObject,
[src]
T: TryFromObject,
fn arity() -> RangeInclusive<usize>
[src]
fn from_args(&VirtualMachine, &mut PyFuncArgs) -> Result<T, ArgumentError>
[src]
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,
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]
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,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
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>,
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]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
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]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,