Remove input from the node definition

This commit is contained in:
Dennis
2022-08-01 23:44:19 -07:00
committed by Keavon Chambers
parent aa5e6f43f6
commit 4b8c0ec4e1
4 changed files with 99 additions and 84 deletions
+4 -12
View File
@@ -3,24 +3,16 @@
pub mod generic;
pub mod ops;
pub mod structural;
//pub mod structural;
pub mod value;
#[rustfmt::skip]
pub trait Node< 'n, Input> {
type Output : 'n;
pub trait Node<'n> {
type Output: 'n; // TODO: replace with generic associated type
fn eval(&'n self, input: Input) -> Self::Output;
fn eval(&'n self) -> Self::Output;
}
// TODO: Fix exec trait
pub trait Exec<'n>: Node<'n, ()> {
fn exec(&'n self) -> Self::Output {
self.eval(())
}
}
impl<'n, T: Node<'n, ()>> Exec<'n> for T {}
pub trait Cache {
fn clear(&mut self);
}