pub struct PySharedRef<'a, T: 'a + ?Sized> { /* private fields */ }
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.

Panics

Panics if the value is currently mutably borrowed.

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.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.