rsdiff-core 0.0.2

This is the core library for the Acme project. It contains the core primitives that are used throughout the project.
Documentation
/*
    Appellation: operator <module>
    Contrib: FL03 <jo3mccain@icloud.com>
*/
use crate::ops::{OpKind, OperandType};

pub trait Operator {
    fn kind(&self) -> OpKind;

    fn name(&self) -> &str;

    #[doc(hidden)]
    fn optype(&self) -> Box<dyn OperandType> {
        self.kind().optype()
    }
}

/*
 **************** implementations ****************
*/

impl Operator for Box<dyn Operator> {
    fn kind(&self) -> OpKind {
        self.as_ref().kind()
    }

    fn name(&self) -> &str {
        self.as_ref().name()
    }
}