Created input types.

This commit is contained in:
Zachary Sunforge
2023-06-14 15:39:02 -07:00
parent 19b8bc607c
commit 45ec03dfd1
6 changed files with 59 additions and 3 deletions

View File

@ -0,0 +1,20 @@
use crate::cell::CellView;
use crate::transducer::Stateful;
pub struct StatefulInput<'a, T: Copy> {
pub state_cell: CellView<'a, T>,
}
impl<'a, T: Copy> Stateful for StatefulInput<'a, T> {
type Value = T;
#[inline(always)]
fn state_cell(&self) -> CellView<'a, Self::Value> {
self.state_cell
}
#[inline]
fn state(&self) -> Self::Value {
self.state_cell.get()
}
}