Skip to content

pyo3_utils

Python integration for the pyo3-utils crate.

Classes:

Name Description
PyMatchRefMixin

Rust match &self for Python.

PyMatchMutMixin

Rust match &mut self for Python.

PyMatchIntoMixin

Rust match self for Python.

__all__ module-attribute

__all__ = ['PyMatchIntoMixin', 'PyMatchMutMixin', 'PyMatchRefMixin']

PyMatchRefMixin

Bases: Generic[_T]

Rust match &self for Python.

This class is only used to provide type annotations, the actual implementation of the methods is handled by the pyo3 extension module.

Note

This class can only be used when TYPE_CHECKING.

Methods:

Name Description
match_ref

Equivalent to match &self in Rust.

match_ref

match_ref() -> _T

Equivalent to match &self in Rust.

Source code in python/pyo3-utils/src/pyo3_utils/__init__.py
def match_ref(self, /) -> _T:
    """Equivalent to `match &self` in Rust."""
    ...

PyMatchMutMixin

Bases: Generic[_T]

Rust match &mut self for Python.

This class is only used to provide type annotations, the actual implementation of the methods is handled by the pyo3 extension module.

Note

This class can only be used when TYPE_CHECKING.

Methods:

Name Description
match_mut

Equivalent to match &mut self in Rust.

match_mut

match_mut() -> _T

Equivalent to match &mut self in Rust.

Source code in python/pyo3-utils/src/pyo3_utils/__init__.py
def match_mut(self, /) -> _T:
    """Equivalent to `match &mut self` in Rust."""
    ...

PyMatchIntoMixin

Bases: Generic[_T]

Rust match self for Python.

This class is only used to provide type annotations, the actual implementation of the methods is handled by the pyo3 extension module.

Note

This class can only be used when TYPE_CHECKING.

Methods:

Name Description
match_into

Equivalent to match self in Rust.

match_into

match_into() -> _T

Equivalent to match self in Rust.

Source code in python/pyo3-utils/src/pyo3_utils/__init__.py
def match_into(self, /) -> _T:
    """Equivalent to `match self` in Rust."""
    ...