Skip to main content

IterRec

Enum IterRec 

Source
enum IterRec {
    Lazy {
        iterator: Value,
        next_fn: Value,
        await_items: bool,
    },
    Async {
        iterator: Value,
    },
    List {
        items: Vec<Value>,
        idx: usize,
        deferred: Option<Value>,
        await_items: bool,
    },
}
Expand description

for-in/of の反復の状態(木の評価の exec_for_in と同じ 3 通り)。

Variants§

§

Lazy

利用者定義の反復子・generator を 1 つずつ(open_lazy_iterator)。抜けるときは IteratorClose。 await_items は for-await で同期の反復子を使う場合(要素を await する)。

Fields

§iterator: Value
§next_fn: Value
§await_items: bool
§

Async

for-await の Symbol.asyncIterator。

Fields

§iterator: Value
§

List

一括で取り出した要素(配列・for-in のキーなど)。deferred は途中で溜めた例外(反復を最後まで回したら投げる)。

Fields

§items: Vec<Value>
§idx: usize
§deferred: Option<Value>
§await_items: bool

Auto Trait Implementations§

Blanket Implementations§

Source§

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

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

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

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where 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 T
where 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> Same for T

Source§

type Output = T

Should always be Self
Source§

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

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

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

Source§

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.