Paths
๊ฒฝ๋ก๋ ์๋์ ๊ฐ์ด ๊ตฌ๋ถํฉ๋๋ค:
- ์๋๊ฒฝ๋ก
foo๋๋self::foo๋foo๋ชจ๋ ์์์ ํ์ฌ ๋ชจ๋์ ๊ฐ๋ฆฌํต๋๋ค.super::foo๋foo๋ชจ๋์ ๋ถ๋ชจ ๋ชจ๋์ ๊ฐ๋ฆฌํต๋๋ค.
- ์ ๋ ๊ฒฝ๋ก
crate::foo๋ ํ์ฌ ํฌ๋ ์ดํธ ๋ฃจํธ์ ์๋foo๋ฅผ ๊ฐ๋ฆฌํต๋๋ค.bar::foo๋barํฌ๋ ์ดํธ ์์ ์๋foo๋ฅผ ๊ฐ๋ฆฌํต๋๋ค.
Paths are resolved as follows:
As a relative path:
fooorself::foorefers tofooin the current module,super::foorefers tofooin the parent module.As an absolute path:
crate::foorefers tofooin the root of the current crate,bar::foorefers tofooin thebarcrate.
์ญ์ฃผ
- crate: ๋ฌ์คํธ์ ๊ธฐ๋ณธ ํจํค์ง ํน์ ๋ผ์ด๋ธ๋ฌ๋ฆฌ์ ๋จ์์ ๋๋ค. std๋ฅผ ๊ธฐ๋ณธ ๋ผ์ด๋ธ๋ฌ๋ฆฌ / ๊ธฐ๋ณธ ํฌ๋ ์ดํธ ๋ผ๊ณ ํฉ๋๋ค.