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.

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

Performs the conversion.

Performs the conversion.

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.