pub enum PyIterReturn<T = PyObjectRef> {
    Return(T),
    StopIteration(Option<PyObjectRef>),
}

Variants§

§

Return(T)

§

StopIteration(Option<PyObjectRef>)

Implementations§

source§

impl<T> PyIterReturn<T>

source

pub fn from_result(result: Result<T, Option<PyObjectRef>>) -> Self

source

pub fn into_result(self) -> Result<T, Option<PyObjectRef>>

source

pub fn as_result(&self) -> Result<&T, &Option<PyObjectRef>>

source

pub fn as_result_mut(&mut self) -> Result<&mut T, &mut Option<PyObjectRef>>

source

pub fn map_or<U, F: FnOnce(T) -> U>(self, default: U, f: F) -> U

source

pub fn unwrap_or(self, optb: T) -> T

source

pub fn unwrap_or_else<F: FnOnce(Option<PyObjectRef>) -> T>(self, op: F) -> T

source§

impl<T> PyIterReturn<T>where Option<PyObjectRef>: Debug,

source

pub fn expect(self, msg: &str) -> T

source

pub fn unwrap(self) -> T

source§

impl<T> PyIterReturn<T>where T: Debug,

source§

impl<T> PyIterReturn<T>

source

pub fn map<U, F: FnOnce(T) -> U>(self, op: F) -> PyIterReturn<U>

source

pub fn map_or_else<U, M: FnOnce(T) -> U, F: FnOnce(Option<PyObjectRef>) -> U>( self, fallback: F, map: M ) -> U

source

pub fn and<U>(self, res: PyIterReturn<U>) -> PyIterReturn<U>

source

pub fn and_then<U, F: FnOnce(T) -> PyIterReturn<U>>( self, op: F ) -> PyIterReturn<U>

source§

impl<T> PyIterReturn<T>where T: Default,

source

pub fn unwrap_or_default(self) -> T

source§

impl<T> PyIterReturn<&T>where T: Copy,

source

pub fn copied(self) -> PyIterReturn<T>

source§

impl<T> PyIterReturn<&mut T>where T: Copy,

source

pub fn copied(self) -> PyIterReturn<T>

source§

impl<T> PyIterReturn<&T>where T: Clone,

source

pub fn cloned(self) -> PyIterReturn<T>

source§

impl<T> PyIterReturn<&mut T>where T: Clone,

source

pub fn cloned(self) -> PyIterReturn<T>

source§

impl<T> PyIterReturn<Option<T>>

source

pub fn transpose(self) -> Option<PyIterReturn<T>>

source§

impl PyIterReturn

Trait Implementations§

source§

impl<T> From<PyIterReturn<T>> for Result<T, Option<PyObjectRef>>

source§

fn from(value: PyIterReturn<T>) -> Self

Converts to this type from the input type.
source§

impl<T> From<Result<T, Option<PyObjectRef>>> for PyIterReturn<T>

source§

fn from(value: Result<T, Option<PyObjectRef>>) -> Self

Converts to this type from the input type.
source§

impl<T> IntoIterator for PyIterReturn<T>

§

type Item = T

The type of the elements being iterated over.
§

type IntoIter = IntoIter<T>

Which kind of iterator are we turning this into?
source§

fn into_iter(self) -> IntoIter<T>

Creates an iterator from a value. Read more
source§

impl<T> ResultLike for PyIterReturn<T>

source§

impl ToPyResult for PyIterReturn

source§

impl<T: Traverse> Traverse for PyIterReturn<T>

source§

fn traverse(&self, tracer_fn: &mut TraverseFn<'_>)

impl traverse() with caution! Following those guideline so traverse doesn’t cause memory error!: Read more

Auto Trait Implementations§

§

impl<T = PyObjectRef> !RefUnwindSafe for PyIterReturn<T>

§

impl<T = PyObjectRef> !Send for PyIterReturn<T>

§

impl<T = PyObjectRef> !Sync for PyIterReturn<T>

§

impl<T> Unpin for PyIterReturn<T>where T: Unpin,

§

impl<T = PyObjectRef> !UnwindSafe for PyIterReturn<T>

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
§

impl<T, U> ExactFrom<T> for Uwhere U: TryFrom<T>,

§

fn exact_from(value: T) -> U

§

impl<T, U> ExactInto<U> for Twhere U: ExactFrom<T>,

§

fn exact_into(self) -> U

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.

§

impl<T, U> OverflowingInto<U> for Twhere U: OverflowingFrom<T>,

§

fn overflowing_into(self) -> (U, bool)

§

impl<T, U> RoundingInto<U> for Twhere U: RoundingFrom<T>,

§

fn rounding_into(self, rm: RoundingMode) -> U

source§

impl<T> Same<T> for T

§

type Output = T

Should always be Self
§

impl<T, U> SaturatingInto<U> for Twhere U: SaturatingFrom<T>,

§

fn saturating_into(self) -> U

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.
§

impl<V, T> VZip<V> for Twhere V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T, U> WrappingInto<U> for Twhere U: WrappingFrom<T>,

§

fn wrapping_into(self) -> U

source§

impl<T> PyThreadingConstraint for T