pub struct PositionIterInternal<T> {
pub status: IterStatus<T>,
pub position: usize,
}Fields§
§status: IterStatus<T>§position: usizeImplementations§
Source§impl<T> PositionIterInternal<T>
impl<T> PositionIterInternal<T>
pub const fn new(obj: T, position: usize) -> Self
pub fn set_state<F>( &mut self, state: PyObjectRef, f: F, vm: &VirtualMachine, ) -> PyResult<()>
Sourcepub fn reduce<F, E>(
&self,
func: PyObjectRef,
active: F,
empty: E,
vm: &VirtualMachine,
) -> PyTupleRef
pub fn reduce<F, E>( &self, func: PyObjectRef, active: F, empty: E, vm: &VirtualMachine, ) -> PyTupleRef
Build a pickle-compatible reduce tuple.
func must be resolved before acquiring any lock that guards this
PositionIterInternal, so that the builtins lookup cannot trigger
reentrant iterator access and deadlock.
pub fn next<F>(&mut self, f: F) -> PyResult<PyIterReturn>
pub fn rev_next<F>(&mut self, f: F) -> PyResult<PyIterReturn>
pub fn length_hint<F>(&self, f: F) -> usize
pub fn rev_length_hint<F>(&self, f: F) -> usize
Trait Implementations§
Source§impl<T: Debug> Debug for PositionIterInternal<T>
impl<T: Debug> Debug for PositionIterInternal<T>
Source§impl<T: Traverse> Traverse for PositionIterInternal<T>
impl<T: Traverse> Traverse for PositionIterInternal<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 moreSource§fn clear(&mut self, _out: &mut Vec<PyObjectRef>)
fn clear(&mut self, _out: &mut Vec<PyObjectRef>)
Extract all owned child PyObjectRefs for circular reference resolution (tp_clear).
Called just before object deallocation to break circular references.
Default implementation does nothing.
Auto Trait Implementations§
impl<T> Freeze for PositionIterInternal<T>where
T: Freeze,
impl<T> RefUnwindSafe for PositionIterInternal<T>where
T: RefUnwindSafe,
impl<T> Send for PositionIterInternal<T>where
T: Send,
impl<T> Sync for PositionIterInternal<T>where
T: Sync,
impl<T> Unpin for PositionIterInternal<T>where
T: Unpin,
impl<T> UnsafeUnpin for PositionIterInternal<T>where
T: UnsafeUnpin,
impl<T> UnwindSafe for PositionIterInternal<T>where
T: UnwindSafe,
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