This is my directory structure
covid_19
|__src
|__api
| |__user_api.rs
| |__mod.rs
|__common
| |__response.rs
| |__mod.rs
|__domain
|__user.rs
|__mod.rs
I want to quote user.rs file and response.rs struct in user_api.rs file
user_api.rs:
use crate::common::response;
use crate::domain::user;
use actix_web :: {
post,
web,
Result,
Error,
HttpResponse,
Responder,
};
error message:
error[E0432]: unresolved import `crate::common`
--> web/covid_19/src/api/user_api.rs:1:12
|
1 | use crate::common::response;
| ^^^^^^ could not find `common` in the crate root
error[E0432]: unresolved import `crate::domain`
--> web/covid_19/src/api/user_api.rs:2:12
|
2 | use crate::domain::user;
| ^^^^^^ could not find `domain` in the crate root
Is there any solution? It seems that rust does not support this?