use clap::Subcommand;
use std::sync::Arc;
#[derive(Subcommand, Copy, Clone, Debug, PartialEq, Eq)]
pub enum ViewCommands {
Rdh,
ItsReadoutFrames,
ItsReadoutFramesData,
}
pub trait ViewOpt {
fn view(&self) -> Option<ViewCommands>;
}
impl<T> ViewOpt for &T
where
T: ViewOpt,
{
fn view(&self) -> Option<ViewCommands> {
(*self).view()
}
}
impl<T> ViewOpt for Box<T>
where
T: ViewOpt,
{
fn view(&self) -> Option<ViewCommands> {
(**self).view()
}
}
impl<T> ViewOpt for Arc<T>
where
T: ViewOpt,
{
fn view(&self) -> Option<ViewCommands> {
(**self).view()
}
}