project
├── src
│   ├── datacode.rs
│   └── main.rs
├── Cargo.toml
└── subproject
    ├── src
    │   ├── main.rs
    │   └── lib.rs
    └── Cargo.toml

/// ../project/src/subproject/src/lib.rs:

mod datacode;
use datacode::MyGlobalStruct;

/*

datacode.rs path is ../project/src/datacode.rs

and there are errors:

error: src/subproject/src/lib.rs:9: file not found for module `datacode`
help: src/subproject/src/lib.rs:9: to create the module `datacode`, create file "src/subproject/src/datacode.rs" or "src/subproject/src/datacode/mod.rs"
error: src/subproject/src/lib.rs:10: unresolved import `datacode::MyGlobalStruct`
error: src/subproject/src/lib.rs:10: no `MyGlobalStruct` in `datacode`
*/

But how can I access MyGlobalStruct initialized in …/project/src/main.rs and implemented in …/project/src/datacode.rs in here …/project/src/subproject/src/lib.rs ? 