from_coroutine

from_coroutine (코루틴 기반 이터레이터)

각 반복마다 주어진 코루틴을 호출하는 새 이터레이터를 만드는 함수예요.

출처: Rust 공식 문서

본문

각 반복마다 주어진 코루틴을 호출하는 새 이터레이터를 만들어요. iter::from_fn 과 유사해요. 예를 들어 #[coroutine] || { yield 1; yield 2; yield 3 } 를 from_coroutine 에 넘기면 1, 2, 3 을 산출하는 이터레이터가 돼요.

pub fn from_coroutine<G>(coroutine: G) -> FromCoroutine <G> ⓘ where G: Coroutine <Return = () > + Unpin ,

더 알아보기 (Learn more)

Rust 공식 문서