pub struct PyAtomicRef<T> { /* private fields */ }
Implementations§
Source§impl<T: PyObjectPayload> PyAtomicRef<T>
impl<T: PyObjectPayload> PyAtomicRef<T>
Sourcepub unsafe fn swap(&self, pyref: PyRef<T>) -> PyRef<T>
pub unsafe fn swap(&self, pyref: PyRef<T>) -> PyRef<T>
§Safety
The caller is responsible to keep the returned PyRef alive until no more reference can be used via PyAtomicRef::deref()
pub fn swap_to_temporary_refs(&self, pyref: PyRef<T>, vm: &VirtualMachine)
Source§impl<T: PyObjectPayload> PyAtomicRef<Option<T>>
impl<T: PyObjectPayload> PyAtomicRef<Option<T>>
pub fn deref(&self) -> Option<&Py<T>>
pub fn to_owned(&self) -> Option<PyRef<T>>
Sourcepub unsafe fn swap(&self, opt_ref: Option<PyRef<T>>) -> Option<PyRef<T>>
pub unsafe fn swap(&self, opt_ref: Option<PyRef<T>>) -> Option<PyRef<T>>
§Safety
The caller is responsible to keep the returned PyRef alive until no more reference can be used via PyAtomicRef::deref()
pub fn swap_to_temporary_refs( &self, opt_ref: Option<PyRef<T>>, vm: &VirtualMachine, )
Source§impl PyAtomicRef<PyObject>
impl PyAtomicRef<PyObject>
Sourcepub unsafe fn swap(&self, obj: PyObjectRef) -> PyObjectRef
pub unsafe fn swap(&self, obj: PyObjectRef) -> PyObjectRef
§Safety
The caller is responsible to keep the returned PyRef alive until no more reference can be used via PyAtomicRef::deref()
pub fn swap_to_temporary_refs(&self, obj: PyObjectRef, vm: &VirtualMachine)
Source§impl PyAtomicRef<Option<PyObject>>
impl PyAtomicRef<Option<PyObject>>
pub fn deref(&self) -> Option<&PyObject>
pub fn to_owned(&self) -> Option<PyObjectRef>
Sourcepub unsafe fn swap(&self, obj: Option<PyObjectRef>) -> Option<PyObjectRef>
pub unsafe fn swap(&self, obj: Option<PyObjectRef>) -> Option<PyObjectRef>
§Safety
The caller is responsible to keep the returned PyRef alive until no more reference can be used via PyAtomicRef::deref()
pub fn swap_to_temporary_refs( &self, obj: Option<PyObjectRef>, vm: &VirtualMachine, )
Methods from Deref<Target = Py<T>>§
pub fn downgrade( &self, callback: Option<PyObjectRef>, vm: &VirtualMachine, ) -> PyResult<PyWeakRef<T>>
Trait Implementations§
Source§impl<T: Debug> Debug for PyAtomicRef<T>
impl<T: Debug> Debug for PyAtomicRef<T>
Source§impl Deref for PyAtomicRef<PyObject>
impl Deref for PyAtomicRef<PyObject>
Source§impl<T: PyObjectPayload> Deref for PyAtomicRef<T>
impl<T: PyObjectPayload> Deref for PyAtomicRef<T>
Source§impl From<Option<PyObjectRef>> for PyAtomicRef<Option<PyObject>>
impl From<Option<PyObjectRef>> for PyAtomicRef<Option<PyObject>>
Source§fn from(obj: Option<PyObjectRef>) -> Self
fn from(obj: Option<PyObjectRef>) -> Self
Converts to this type from the input type.
Source§impl<T: PyObjectPayload> From<Option<PyRef<T>>> for PyAtomicRef<Option<T>>
impl<T: PyObjectPayload> From<Option<PyRef<T>>> for PyAtomicRef<Option<T>>
Source§impl From<PyObjectRef> for PyAtomicRef<PyObject>
impl From<PyObjectRef> for PyAtomicRef<PyObject>
Source§fn from(obj: PyObjectRef) -> Self
fn from(obj: PyObjectRef) -> Self
Converts to this type from the input type.
Source§impl<T: PyObjectPayload> From<PyRef<T>> for PyAtomicRef<T>
impl<T: PyObjectPayload> From<PyRef<T>> for PyAtomicRef<T>
Auto Trait Implementations§
impl<T> !Freeze for PyAtomicRef<T>
impl<T> !RefUnwindSafe for PyAtomicRef<T>
impl<T> !Send for PyAtomicRef<T>
impl<T> !Sync for PyAtomicRef<T>
impl<T> Unpin for PyAtomicRef<T>where
T: Unpin,
impl<T> UnwindSafe for PyAtomicRef<T>where
T: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more