# pyo3::class::pyasync::PyAsyncProtocol - Rust
Python Async/Await support interface.
Keywords: rust, rustlang, rust-lang, PyAsyncProtocol

# Trait pyo3::class::pyasync::PyAsyncProtocol [−] [src]

    pub trait PyAsyncProtocol<'p>: PyClass {
        fn __await__(slf: Self::Receiver) -> Self::Result
        where
            Self: PyAsyncAwaitProtocol<'p>,
        { ... }
        fn __aiter__(slf: Self::Receiver) -> Self::Result
        where
            Self: PyAsyncAiterProtocol<'p>,
        { ... }
        fn __anext__(slf: Self::Receiver) -> Self::Result
        where
            Self: PyAsyncAnextProtocol<'p>,
        { ... }
        fn __aenter__(&'p mut self) -> Self::Result
        where
            Self: PyAsyncAenterProtocol<'p>,
        { ... }
        fn __aexit__(
            &'p mut self,
            exc_type: Option<Self::ExcType>,
            exc_value: Option<Self::ExcValue>,
            traceback: Option<Self::Traceback>
        ) -> Self::Result
        where
            Self: PyAsyncAexitProtocol<'p>,
        { ... }
    }

Python Async/Await support interface.

Each method in this trait corresponds to Python async/await implementation.

## Provided methods

### `fn __await__(slf: Self::Receiver) -> Self::Result where
Self: PyAsyncAwaitProtocol<'p>,` [src]

### `fn __aiter__(slf: Self::Receiver) -> Self::Result where
Self: PyAsyncAiterProtocol<'p>,` [src]

### `fn __anext__(slf: Self::Receiver) -> Self::Result where
Self: PyAsyncAnextProtocol<'p>,` [src]

### `fn __aenter__(&'p mut self) -> Self::Result where
Self: PyAsyncAenterProtocol<'p>,` [src]

### `fn __aexit__(
&'p mut self,
exc_type: Option<Self::ExcType>,
exc_value: Option<Self::ExcValue>,
traceback: Option<Self::Traceback>
) -> Self::Result where
Self: PyAsyncAexitProtocol<'p>,` [src]

Loading content...

## Implementors

Loading content...