use crate::dsl::{FloatHandler, IntegerHandler}; use std::marker::PhantomData; pub struct Handler_F64 { store: StoreFn, __phantom: PhantomData, } impl Handler_F64 { pub fn create(f: StoreFn) -> Self { return Self { store: f, __phantom: PhantomData::default(), }; } } impl FloatHandler for Handler_F64 { fn handleFloat(&self, dst: &mut S, value: f64) { (self.store)(dst, value); } } pub struct Handler_F32 { store: StoreFn, __phantom: PhantomData, } impl Handler_F32 { pub fn create(f: StoreFn) -> Self { return Self { store: f, __phantom: PhantomData::default(), }; } } impl FloatHandler for Handler_F32 { fn handleFloat(&self, dst: &mut S, value: f64) { (self.store)(dst, value as f32); } }