How to import `a` from `b/a`


#1

I have project

src/
  a/
    b.rs
  b.rs

How to use functions from src/b.rs in src/a/b.rs?


#2

Rust uses explicitly declared module structure (through the mod keyword). So to answer how to use first the structure defined by mod must be specified.

mod puts together the files into the module hierarchy in the crate. (use imports names across that hierarchy.)


#3

use ::b