---
source: https://iinventedlight.com/library/notes/rust-paths-use-module-files.md
title: "Rust paths, use, and modules in files"
license: CC-BY-4.0
license_url: https://creativecommons.org/licenses/by/4.0/
source_license: "MIT OR Apache-2.0 (rust-lang/book and cited companions); prose restates cited source lines in own words"
license_family: rust-mit
attribution: "Summary by iinventedlight (AI-assisted). Sources: Rust book + Rust by Example use page (MIT OR Apache-2.0). Notices: The Rust Programming Language book (rust-lang/book): Copyright (c) 2010 The Rust Project Developers; MIT OR Apache-2.0, used under MIT (https://github.com/rust-lang/book/blob/main/LICENSE-MIT). Rust by Example (rust-lang/rust-by-example): Copyright (c) 2014 Jorge Aparicio; MIT OR Apache-2.0, used under MIT (https://github.com/rust-lang/rust-by-example/blob/master/LICENSE-MIT)."
author: "iinventedlight (synthesis of cited sources); text drafted with AI assistance"
date: 2026-11-09
status: published
approved_by: "Cole Withington, 2026-11-09 13:40 PT: \"Yes, publish all 15 Rust drafts\""
checked_on: 2026-11-09
as_of: 2026-11-09
confidence: medium
untested: "No Rust code was run for this note; only the fetched documentation pages were read."
category: coding-references
topic_area: "code-systems: Rust modules"
tags: [rust, paths, use, modules, files]
client: Librarian
sources:
  - id: S1
    title: "Paths for Referring to an Item in the Module Tree"
    publisher: The Rust Project (The Rust Programming Language book)
    url: https://doc.rust-lang.org/book/ch07-03-paths-for-referring-to-an-item-in-the-module-tree.html
    accessed: 2026-11-09
    license: "MIT OR Apache-2.0"
  - id: S2
    title: "Bringing Paths into Scope with the use Keyword"
    publisher: The Rust Project (The Rust Programming Language book)
    url: https://doc.rust-lang.org/book/ch07-04-bringing-paths-into-scope-with-the-use-keyword.html
    accessed: 2026-11-09
    license: "MIT OR Apache-2.0"
  - id: S3
    title: "Separating Modules into Different Files"
    publisher: The Rust Project (The Rust Programming Language book)
    url: https://doc.rust-lang.org/book/ch07-05-separating-modules-into-different-files.html
    accessed: 2026-11-09
    license: "MIT OR Apache-2.0"
  - id: S4
    title: "The use declaration - Rust By Example"
    publisher: Rust by Example (rust-lang/rust-by-example)
    url: https://doc.rust-lang.org/rust-by-example/mod/use.html
    accessed: 2026-11-09
    license: "MIT OR Apache-2.0"
---
# Rust paths, use, and modules in files

**Answer:** Absolute and relative paths chain identifiers with `::`. Bringing a path into scope with `use` behaves like a filesystem symbolic link.

`mod` is not a textual include; it points Rust at the module's code in another file.

`use` can bind a full path to a shorter name for easier access.

## Claims

- id: C1
  claim: Paths are followed by identifiers separated by double colons.
  source: S1
  evidence: "Both absolute and relative paths are followed by one or more identifiers separated by double"
- id: C2
  claim: Adding use and a path is similar to creating a symbolic link.
  source: S2
  evidence: "Adding use and a path in a scope is similar to creating a symbolic link"
- id: C3
  claim: pub use makes an item available for others to bring into scope.
  source: S2
  evidence: "we're bringing an item into scope but also making that item available for others to"
- id: C4
  claim: mod is not an include operation from other languages.
  source: S3
  evidence: "mod is not an \"include\" operation that you may have seen in other programming languages."

- id: C5
  claim: The use declaration binds a full path to a new name for easier access.
  source: S4
  evidence: "The use declaration can be used to bind a full path to a new name,"

## Sources

- [S1] Paths for Referring to an Item in the Module Tree. The Rust Project (The Rust Programming Language book). https://doc.rust-lang.org/book/ch07-03-paths-for-referring-to-an-item-in-the-module-tree.html . License: MIT OR Apache-2.0. Accessed 2026-11-09.
- [S2] Bringing Paths into Scope with the use Keyword. The Rust Project (The Rust Programming Language book). https://doc.rust-lang.org/book/ch07-04-bringing-paths-into-scope-with-the-use-keyword.html . License: MIT OR Apache-2.0. Accessed 2026-11-09.
- [S3] Separating Modules into Different Files. The Rust Project (The Rust Programming Language book). https://doc.rust-lang.org/book/ch07-05-separating-modules-into-different-files.html . License: MIT OR Apache-2.0. Accessed 2026-11-09.

- [S4] The use declaration - Rust By Example. Rust by Example (rust-lang/rust-by-example). https://doc.rust-lang.org/rust-by-example/mod/use.html . License: MIT OR Apache-2.0. Accessed 2026-11-09.

License: this note is CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Summary by iinventedlight (AI-assisted). Sources and notices: The Rust Programming Language book (rust-lang/book): Copyright (c) 2010 The Rust Project Developers; MIT OR Apache-2.0, used under MIT (https://github.com/rust-lang/book/blob/main/LICENSE-MIT). Rust by Example (rust-lang/rust-by-example): Copyright (c) 2014 Jorge Aparicio; MIT OR Apache-2.0, used under MIT (https://github.com/rust-lang/rust-by-example/blob/master/LICENSE-MIT). Text was condensed and changed from the originals.

---

Agents: [/agents.md](/agents.md) | [/.well-known/agent-library.json](/.well-known/agent-library.json).
