struct GenReplay {
sent: Vec<GenCompletion>,
counter: usize,
target: usize,
suspending: bool,
yielded: Value,
returning: Option<Value>,
}Expand description
generator 本体の replay 実行中に保持する一時状態。
resume のたびに本体を先頭から再実行し、target 番目の yield で中断(suspend)する。
それより手前の yield には sent に保存済みの resume 値を返して通過させる。
Fields§
§sent: Vec<GenCompletion>既に通過した各 yield の resume 結果。
counter: usizeこの replay でこれまでに遭遇した yield 数。
target: usizeこの index の yield に達したら中断する(= sent.len())。
suspending: bool中断(suspend)中フラグ。Err を最上位まで巻き戻すための番兵。
yielded: Value中断地点で yield された値。
returning: Option<Value>強制Return時の戻り値を一時保持する。
Auto Trait Implementations§
impl !RefUnwindSafe for GenReplay
impl !Send for GenReplay
impl !Sync for GenReplay
impl !UnwindSafe for GenReplay
impl Freeze for GenReplay
impl Unpin for GenReplay
impl UnsafeUnpin for GenReplay
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