use crate::View;
#[derive(Default, Debug, Clone)]
pub struct Constant<T> {
val: T,
}
impl<T> Constant<T> {
pub fn new(val: T) -> Self {
Self { val }
}
}
impl<T: num::Float> View<T> for Constant<T> {
fn update(&mut self, _val: T) {}
fn last(&self) -> Option<T> {
Some(self.val)
}
}