# 모듈과 패키지 (Rust) > 크레이트 구조, 모듈 (mod), pub 가시성, use 키워드, Cargo.toml, workspaces - 18 면접 질문 - Junior - [면접 질문: Rust](https://sharpskill.dev/ko/technologies/rust/interview-questions.md) ## 1. Rust에서 라이브러리 크레이트(library crate)의 루트가 되는 파일은 무엇입니까? **답변** src/lib.rs 파일은 Rust 라이브러리의 관례적인 진입점입니다. Cargo는 이를 자동으로 라이브러리 크레이트의 루트로 인식합니다. 이 파일은 라이브러리의 공개 모듈을 선언하고 크레이트 사용자에게 노출되는 API를 정의합니다. ## 2. Rust 파일에서 서브모듈을 선언하려면 어떤 키워드를 사용하나요? **답변** mod 키워드는 모듈을 선언하는 데 사용됩니다. 모듈 코드를 담은 블록을 뒤에 붙이거나, 코드가 별도의 파일에 있는 경우 단순히 모듈 이름만 붙일 수 있습니다. 그러면 Cargo가 해당 파일을 자동으로 찾습니다. ## 3. Rust 모듈에서 항목(함수, 구조체 등)의 기본 가시성은 무엇인가요? **답변** Rust에서는 모든 항목이 기본적으로 비공개입니다. 이러한 설계 결정은 캡슐화를 촉진하며, 무엇을 공개적으로 노출할지 개발자가 명시적으로 정하도록 강제합니다. 항목을 모듈 외부에서 접근 가능하게 하려면 pub 키워드를 사용해야 합니다. ## 15개 추가 질문 이용 가능 - 타입을 가져와서 경로 접두사 없이 사용할 수 있게 하는 구문은 무엇인가요? - import 시작 부분에 있는 crate:: 경로 접두사는 무엇을 의미하나요? 무료로 가입하기: 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 - [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 - [async/await](https://sharpskill.dev/ko/technologies/rust/interview-questions/async-await.md): 22개 질문, 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/modules-packages