Struct pyo3_async::GilUnbound

source ·
#[repr(transparent)]
pub struct GilUnbound<T>(pub T);
Expand description

Wrapper for Future/[Stream] that releases GIL while polling in PyFuture/PyStream.

Can be instantiated with [UnbindGIL::unbind_gil].

Tuple Fields§

§0: T

Trait Implementations§

source§

impl<T: Debug> Debug for GilUnbound<T>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<F, T, E> PyFuture for GilUnbound<F>where F: Future<Output = Result<T, E>> + Send, T: IntoPy<PyObject> + Send, E: Send, PyErr: From<E>,

source§

fn poll_py( self: Pin<&mut Self>, py: Python<'_>, cx: &mut Context<'_> ) -> Poll<PyResult<PyObject>>

GIL-bound Future::poll.
source§

impl<S, T, E> PyStream for GilUnbound<S>where S: Stream<Item = Result<T, E>> + Send, T: IntoPy<PyObject> + Send, E: Send, PyErr: From<E>,

source§

fn poll_next_py( self: Pin<&mut Self>, py: Python<'_>, cx: &mut Context<'_> ) -> Poll<Option<PyResult<PyObject>>>

GIL-bound [Stream::poll_next].
source§

impl<'pin, T> Unpin for GilUnbound<T>where __GilUnbound<'pin, T>: Unpin,

Auto Trait Implementations§

§

impl<T> RefUnwindSafe for GilUnbound<T>where T: RefUnwindSafe,

§

impl<T> Send for GilUnbound<T>where T: Send,

§

impl<T> Sync for GilUnbound<T>where T: Sync,

§

impl<T> UnwindSafe for GilUnbound<T>where T: UnwindSafe,

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

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

source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<T> UnbindGil for T

source§

fn unbind_gil(self) -> GilUnbound<Self>

source§

impl<T> Ungil for Twhere T: Send,