I'm new two rust I and I excuse for my stupid question. I do not even know how to search it in existing questions. Anyway I have file named A and struct A inside it. I want to use A structure and methods implemented for it in file B. But in order to do it I need to do
The problem is that the struct and module have the same name, which prevents the struct from being imported where the module is already in scope. The standard solution is to use lowercase names for modules and capitalized names for types:
mod a {
pub struct A;
impl A { pub fn some_function() {} }
}
use a::*;
fn main() {
A::some_function();
}