//! TODO mod impl_std_ops; pub mod serial; /// TODO #[derive(Debug, Clone, PartialEq, Eq)] pub enum Op { /// TODO NoOp(T), /// TODO Transpose(T), } impl Op { /// TODO pub fn inner_ref(&self) -> &T { match self { Op::NoOp(obj) => &obj, Op::Transpose(obj) => &obj } } /// TODO pub fn as_ref(&self) -> Op<&T> { match self { Op::NoOp(obj) => Op::NoOp(&obj), Op::Transpose(obj) => Op::Transpose(&obj) } } /// TODO pub fn convert(self) -> Op where T: Into { match self { Op::NoOp(obj) => Op::NoOp(obj.into()), Op::Transpose(obj) => Op::Transpose(obj.into()) } } /// TODO /// TODO: Rewrite the other functions by leveraging this one pub fn map_same_op U>(self, f: F) -> Op { match self { Op::NoOp(obj) => Op::NoOp(f(obj)), Op::Transpose(obj) => Op::Transpose(f(obj)) } } } impl From for Op { fn from(obj: T) -> Self { Self::NoOp(obj) } }