So, I have a hierarchy of files that have their own classes. Here is an example:
mod query;
struct Row<T>{
data: Vec<Query<T>>,
}
impl<T> Row<T>{
fn new(array: Vec<Query<T>>) -> Row<T>{
Row{
data: array,
}
}
}
Although it says the files are there, it says that "Query is an undeclared type," even when it exists in another file. The code works when everything is in the same file.
This is documented in the Rust book, specifically the section on modules. When you have different modules, you need to bring items from the other modules into scope using the
use
keyword.