
Web Frameworks
Actix-web, Axum, Rocket, routing, middleware, handlers, state management, JSON serialization
1Which Rust web framework is built directly on tokio and tower, favoring a modular trait-based approach?
Which Rust web framework is built directly on tokio and tower, favoring a modular trait-based approach?
Câu trả lời
Axum is built on tokio and tower, using tower's Service and Layer system for middleware. This architecture enables great composability and natural integration with the tower ecosystem (timeout, rate limiting, tracing). Axum leverages Rust traits for data extraction and type-safe handler management.
2How to define a GET route with a path parameter in Axum?
How to define a GET route with a path parameter in Axum?
Câu trả lời
In Axum, path parameters use the :param syntax in route definition, and are extracted via the Path<T> extractor. Type T must implement Deserialize, enabling type-safe extraction. The order of extractors in the handler signature determines how data is extracted from the request.
3What is the distinctive feature of Actix-web's execution model compared to other Rust frameworks?
What is the distinctive feature of Actix-web's execution model compared to other Rust frameworks?
Câu trả lời
Actix-web uses the actor model where each worker is an independent actor with its own state. Requests are handled by actors communicating via asynchronous messages. This model provides excellent isolation and natural horizontal scalability, though the actor model is no longer mandatory in recent versions.
How to share application state between handlers in Axum?
What is Rocket's syntax for defining a route with automatic JSON body validation?
+19 câu hỏi phỏng vấn
Các chủ đề phỏng vấn Rust khác
Rust Basics
Ownership & Borrowing
Structs & Enums
Error Handling
Collections
Modules & Packages
Traits
Generics
Lifetimes
Iterators & Closures
Smart Pointers
Concurrency Basics
async/await
Testing
Cargo & Ecosystem
Pattern Matching
Macros
Serde & Serialization
Unsafe Rust
Advanced Traits
Advanced Lifetimes
Type System
Tokio & Async I/O
Performance Optimization
Memory Management
Database Integration
Rust Design Patterns
Nắm vững Rust cho lần phỏng vấn tiếp theo
Truy cập tất cả câu hỏi, flashcards, bài kiểm tra kỹ thuật, bài tập code review và mô phỏng phỏng vấn.
Bắt đầu miễn phí