I have a src/lib.rs
that contains:
pub trait Compile {
fn from_source(src: &src) {
parser::parse(src);
}
}
And a src/compiler/interpreter.rs
use crate::Compile; // ERROR HERE - No Compile in the root
pub struct Interpreter;
impl Compile for Interpreter {}
I also have a src/compiler.rs
pub mod interpreter;
I want to be able to use the Compile trait within my interpreter impl however I cannot seem to figure out how import the trait. Any thoughts?
Its possible to do this in src/main.rs
by doing:
mod lib;
use lib::Compile;