use super::matter_code::MatterCode;
use super::sealed::Sealed;
use crate::core::matter::error::ValidationError;
use crate::core::matter::sizage::Sizage;
#[allow(
private_bounds,
reason = "Sealed trait pattern restricts implementors to this crate"
)]
pub trait CesrCode: Sealed + Copy + Eq + core::fmt::Debug {
fn to_matter_code(&self) -> MatterCode;
fn as_str(&self) -> &'static str;
fn get_sizage(&self) -> Sizage {
self.to_matter_code().get_sizage()
}
fn raw_size(&self) -> Result<usize, ValidationError> {
self.to_matter_code().raw_size()
}
}