Struct cpython::PySharedRef [−][src]
pub struct PySharedRef<'a, T: 'a + ?Sized> { /* fields omitted */ }
Expand description
A reference to PySharedRefCell
owned by a Python object.
This is a lifetime-bound reference to the PySharedRefCell data field, and will be created by the automatically generated accessor function.
ⓘ
impl MyType {
fn data_name<'a>(&'a self, py: Python<'a>) -> PySharedRef<'a, T> { ... }
}
Implementations
Immutably borrows the wrapped value, returning an error if the value is currently mutably borrowed.
Mutably borrows the wrapped value.
Any existing leaked references will be invalidated.
Panics
Panics if the value is currently borrowed.
Mutably borrows the wrapped value, returning an error if the value is currently borrowed.
Creates an immutable reference which is not bound to lifetime.
Panics
Panics if the value is currently mutably borrowed.
Creates an immutable reference which is not bound to lifetime, returning an error if the value is currently mutably borrowed.