pub enum PyIterReturn<T = PyObjectRef> {
Return(T),
StopIteration(Option<PyObjectRef>),
}
Variants§
Return(T)
StopIteration(Option<PyObjectRef>)
Implementations§
Source§impl<T> PyIterReturn<T>
impl<T> PyIterReturn<T>
pub fn from_result(result: Result<T, Option<PyObjectRef>>) -> Self
pub fn into_result(self) -> Result<T, Option<PyObjectRef>>
pub fn as_result(&self) -> Result<&T, &Option<PyObjectRef>>
pub fn as_result_mut(&mut self) -> Result<&mut T, &mut Option<PyObjectRef>>
pub fn map_or<U, F: FnOnce(T) -> U>(self, default: U, f: F) -> U
pub fn unwrap_or(self, optb: T) -> T
pub fn unwrap_or_else<F: FnOnce(Option<PyObjectRef>) -> T>(self, op: F) -> T
Source§impl<T> PyIterReturn<T>
impl<T> PyIterReturn<T>
Source§impl<T> PyIterReturn<T>where
T: Debug,
impl<T> PyIterReturn<T>where
T: Debug,
pub fn unwrap_err(self) -> Option<PyObjectRef>
Source§impl<T> PyIterReturn<T>
impl<T> PyIterReturn<T>
pub fn map<U, F: FnOnce(T) -> U>(self, op: F) -> PyIterReturn<U>
pub fn map_or_else<U, M: FnOnce(T) -> U, F: FnOnce(Option<PyObjectRef>) -> U>( self, fallback: F, map: M, ) -> U
pub fn and<U>(self, res: PyIterReturn<U>) -> PyIterReturn<U>
pub fn and_then<U, F: FnOnce(T) -> PyIterReturn<U>>( self, op: F, ) -> PyIterReturn<U>
Source§impl<T> PyIterReturn<T>where
T: Default,
impl<T> PyIterReturn<T>where
T: Default,
pub fn unwrap_or_default(self) -> T
Source§impl<T> PyIterReturn<&T>where
T: Copy,
impl<T> PyIterReturn<&T>where
T: Copy,
pub fn copied(self) -> PyIterReturn<T>
Source§impl<T> PyIterReturn<&mut T>where
T: Copy,
impl<T> PyIterReturn<&mut T>where
T: Copy,
pub fn copied(self) -> PyIterReturn<T>
Source§impl<T> PyIterReturn<&T>where
T: Clone,
impl<T> PyIterReturn<&T>where
T: Clone,
pub fn cloned(self) -> PyIterReturn<T>
Source§impl<T> PyIterReturn<&mut T>where
T: Clone,
impl<T> PyIterReturn<&mut T>where
T: Clone,
pub fn cloned(self) -> PyIterReturn<T>
Source§impl<T> PyIterReturn<Option<T>>
impl<T> PyIterReturn<Option<T>>
pub fn transpose(self) -> Option<PyIterReturn<T>>
Source§impl PyIterReturn
impl PyIterReturn
pub fn from_pyresult(result: PyResult, vm: &VirtualMachine) -> PyResult<Self>
pub fn from_getitem_result( result: PyResult, vm: &VirtualMachine, ) -> PyResult<Self>
pub fn into_async_pyresult(self, vm: &VirtualMachine) -> PyResult
Trait Implementations§
Source§impl<T> From<PyIterReturn<T>> for Result<T, Option<PyObjectRef>>
impl<T> From<PyIterReturn<T>> for Result<T, Option<PyObjectRef>>
Source§fn from(value: PyIterReturn<T>) -> Self
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>
impl<T> From<Result<T, Option<PyObjectRef>>> for PyIterReturn<T>
Source§impl<T> IntoIterator for PyIterReturn<T>
impl<T> IntoIterator for PyIterReturn<T>
Source§impl<T> ResultLike for PyIterReturn<T>
impl<T> ResultLike for PyIterReturn<T>
Source§impl ToPyResult for PyIterReturn
impl ToPyResult for PyIterReturn
fn to_pyresult(self, vm: &VirtualMachine) -> PyResult
Source§impl<T: Traverse> Traverse for PyIterReturn<T>
impl<T: Traverse> Traverse for PyIterReturn<T>
Source§fn traverse(&self, tracer_fn: &mut TraverseFn<'_>)
fn traverse(&self, tracer_fn: &mut TraverseFn<'_>)
impl
traverse()
with caution! Following those guideline so traverse doesn’t cause memory error!: Read moreAuto Trait Implementations§
impl<T> Freeze for PyIterReturn<T>where
T: Freeze,
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> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more