use crate::FilterToSampler; use interface::{Data, Read, Update, Write, UID}; #[derive(Default)] pub struct Sampler(f64); impl Update for Sampler {} impl Read for Sampler { fn read(&mut self, data: Data) { self.0 = *data; } } #[derive(UID)] #[uid(data = f64)] pub enum SamplerToSink {} impl Write for Sampler { fn write(&mut self) -> Option> { Some(Data::new(self.0)) } }