# async/await (Rust) > async 함수, Future 트레이트, tokio 런타임, async 블록, .await 구문, Streams, Pin, 취소, executor 패턴 - 22 면접 질문 - Mid-Level - [면접 질문: Rust](https://sharpskill.dev/ko/technologies/rust/interview-questions.md) ## 1. Rust에서 async 키워드로 선언된 함수는 무엇을 반환하나요? **답변** async 함수는 Future 트레이트를 구현하는 타입을 자동으로 반환합니다. 컴파일러는 함수 본문을 Future를 구현하는 상태 기계(state machine)로 변환합니다. 반환 값은 즉시 계산되지 않으며, Future가 .await로 대기되거나 runtime에 의해 실행될 때만 계산됩니다. ## 2. Rust에서 Future 트레이트의 주요 역할은 무엇인가요? **답변** Future 트레이트는 아직 완료되지 않았을 수 있는 비동기 계산을 나타냅니다. poll 메서드를 통해 executor는 Future가 준비되었는지(Poll::Ready) 또는 대기해야 하는지(Poll::Pending)를 확인할 수 있습니다. 이는 Rust 비동기 처리의 근본적인 메커니즘으로, 논블로킹이면서 효율적인 실행을 가능하게 합니다. ## 3. Rust에서 async 코드를 실행하려면 왜 tokio 같은 runtime이 필요한가요? **답변** Rust는 언어를 최소한으로 유지하고 필요에 따라 runtime을 선택할 수 있도록 표준 라이브러리에 비동기 runtime을 포함하지 않습니다. tokio 같은 runtime은 Future를 poll하는 executor, 태스크를 관리하는 scheduler, 그리고 비동기 I/O를 제공합니다. runtime이 없으면 Future는 결코 실행되지 않습니다. ## 19개 추가 질문 이용 가능 - Rust에서 async block과 async function의 차이점은 무엇인가요? - Rust에서 Future에 .await를 사용하면 어떤 일이 발생하나요? 무료로 가입하기: https://sharpskill.dev/ko/login ## 기타 Rust 면접 주제 - [Rust 기초](https://sharpskill.dev/ko/technologies/rust/interview-questions/rust-basics.md): 25개 질문, Junior - [Ownership & Borrowing](https://sharpskill.dev/ko/technologies/rust/interview-questions/ownership-borrowing.md): 22개 질문, Junior - [Structs & Enums](https://sharpskill.dev/ko/technologies/rust/interview-questions/structs-enums.md): 20개 질문, Junior - [에러 처리](https://sharpskill.dev/ko/technologies/rust/interview-questions/error-handling.md): 18개 질문, Junior - [컬렉션](https://sharpskill.dev/ko/technologies/rust/interview-questions/collections.md): 20개 질문, Junior - [모듈과 패키지](https://sharpskill.dev/ko/technologies/rust/interview-questions/modules-packages.md): 18개 질문, Junior - [Traits](https://sharpskill.dev/ko/technologies/rust/interview-questions/traits.md): 22개 질문, Mid-Level - [Generics](https://sharpskill.dev/ko/technologies/rust/interview-questions/generics.md): 20개 질문, Mid-Level - [Lifetimes](https://sharpskill.dev/ko/technologies/rust/interview-questions/lifetimes.md): 20개 질문, Mid-Level - [Iterators & Closures](https://sharpskill.dev/ko/technologies/rust/interview-questions/iterators-closures.md): 22개 질문, Mid-Level - [Smart Pointers](https://sharpskill.dev/ko/technologies/rust/interview-questions/smart-pointers.md): 22개 질문, Mid-Level - [Concurrency Basics](https://sharpskill.dev/ko/technologies/rust/interview-questions/concurrency-basics.md): 20개 질문, Mid-Level - [Testing](https://sharpskill.dev/ko/technologies/rust/interview-questions/testing.md): 18개 질문, Mid-Level - [Cargo & Ecosystem](https://sharpskill.dev/ko/technologies/rust/interview-questions/cargo-ecosystem.md): 18개 질문, Mid-Level - [Pattern Matching](https://sharpskill.dev/ko/technologies/rust/interview-questions/pattern-matching.md): 18개 질문, Mid-Level - [매크로](https://sharpskill.dev/ko/technologies/rust/interview-questions/macros.md): 20개 질문, Mid-Level - [Serde와 직렬화](https://sharpskill.dev/ko/technologies/rust/interview-questions/serde-serialization.md): 20개 질문, Mid-Level - [Unsafe Rust](https://sharpskill.dev/ko/technologies/rust/interview-questions/unsafe-rust.md): 20개 질문, Senior - [고급 트레잇](https://sharpskill.dev/ko/technologies/rust/interview-questions/advanced-traits.md): 22개 질문, Senior - [고급 lifetime](https://sharpskill.dev/ko/technologies/rust/interview-questions/advanced-lifetimes.md): 20개 질문, Senior - [Type System](https://sharpskill.dev/ko/technologies/rust/interview-questions/type-system.md): 20개 질문, Senior - [Tokio & Async I/O](https://sharpskill.dev/ko/technologies/rust/interview-questions/tokio-async.md): 22개 질문, Senior - [성능 최적화](https://sharpskill.dev/ko/technologies/rust/interview-questions/performance-optimization.md): 20개 질문, Senior - [Memory Management](https://sharpskill.dev/ko/technologies/rust/interview-questions/memory-management.md): 20개 질문, Senior - [Web Frameworks](https://sharpskill.dev/ko/technologies/rust/interview-questions/web-frameworks.md): 22개 질문, Senior - [Database Integration](https://sharpskill.dev/ko/technologies/rust/interview-questions/database-integration.md): 20개 질문, Senior - [Rust 디자인 패턴](https://sharpskill.dev/ko/technologies/rust/interview-questions/design-patterns.md): 20개 질문, Senior --- Source: SharpSkill (https://sharpskill.dev), tech interview preparation for your real stack. HTML version of this page: https://sharpskill.dev/ko/technologies/rust/interview-questions/async-await