pub enum BopIter {
Array {
items: Vec<Value>,
pos: usize,
},
String {
chars: Vec<char>,
pos: usize,
},
Dict {
keys: Vec<String>,
pos: usize,
},
}Expand description
Built-in lazy iterator shapes. Each one holds a snapshot of
the source sequence plus a cursor; advancing via Self::next
yields items until exhausted. A user-defined iterator doesn’t
need to live here — it’s just a struct with a .next()
method, dispatched through the ordinary method path.
Variants§
Array
Over a cloned-off array snapshot. Subsequent mutation of the original array doesn’t affect the iterator — matches how most scripting languages present iteration.
String
Over a string’s Unicode code points, one item per code point. Each yielded value is a single-char string.
Dict
Over a dict’s keys, in declaration order. Same shape
for k in dict uses when the receiver is a plain dict.
Implementations§
Trait Implementations§
Auto Trait Implementations§
impl Freeze for BopIter
impl !RefUnwindSafe for BopIter
impl !Send for BopIter
impl !Sync for BopIter
impl Unpin for BopIter
impl UnsafeUnpin for BopIter
impl !UnwindSafe for BopIter
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