trait_IntoFuture

trait_IntoFuture (Future 변환 트레이트)

타입을 Future로 변환하는 트레이트예요. .await가 가능한 타입을 위한 핵심 트레이트예요.

출처: Rust 공식 문서

본문

IntoFutureFuture로 변환될 수 있는 타입을 위한 트레이트예요. .await 문법이 이 트레이트를 사용해 값을 poll할 Future로 변환해요.

pub trait IntoFuture {
    type Output;
    type IntoFuture: Future<Output = Self::Output>;

    // 필수 메서드
    fn into_future(self) -> Self::IntoFuture;
}

더 알아보기 (Learn more)

Rust 공식 문서