use crate::buffer::hold;
pub trait Mode {
const ENABLED: bool;
type Projection: Copy + Default + From<hold::Charge>;
}
#[derive(Clone, Copy, Default)]
pub struct Off;
impl Mode for Off {
const ENABLED: bool = false;
type Projection = [hold::Charge; 0];
}
pub enum On {}
impl Mode for On {
const ENABLED: bool = true;
type Projection = [hold::Charge; 1];
}
const _: () = {
assert!(core::mem::size_of::<<Off as Mode>::Projection>() == 0);
assert!(
core::mem::size_of::<<On as Mode>::Projection>() == core::mem::size_of::<hold::Charge>()
);
};