use std::{error, fmt};
#[non_exhaustive]
#[derive(Debug, Copy, Clone, Eq, PartialEq, Hash)]
pub enum MediaTypeError {
InvalidTypeName,
InvalidSubtypeName,
InvalidSuffix,
InvalidParams,
InvalidParamName,
InvalidParamValue,
}
impl fmt::Display for MediaTypeError {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
let msg = match self {
Self::InvalidTypeName => "Invalid type name",
Self::InvalidSubtypeName => "Invalid subtype name",
Self::InvalidSuffix => "Invalid suffix",
Self::InvalidParams => "Invalid params",
Self::InvalidParamName => "Invalid param name",
Self::InvalidParamValue => "Invalid param value",
};
f.write_str(msg)
}
}
impl error::Error for MediaTypeError {}