pub enum MimeError {
Show 23 variants
InvalidGlobWeight {
weight: u16,
},
InvalidMagicMatcher {
reason: String,
},
InvalidXmlAttribute {
element: String,
attribute: String,
value: String,
reason: String,
},
InvalidXmlElement {
element: String,
reason: String,
},
InvalidClassifierInput {
reason: String,
},
DuplicateDetectorName {
name: String,
},
EmptyDetectorName,
InvalidDetectorName {
name: String,
reason: String,
},
UnknownDetector {
name: String,
},
DetectorUnavailable {
name: String,
reason: String,
},
NoAvailableDetector {
reason: String,
},
DetectorBackend {
backend: String,
reason: String,
},
DuplicateClassifierName {
name: String,
},
EmptyClassifierName,
InvalidClassifierName {
name: String,
reason: String,
},
UnknownClassifier {
name: String,
},
ClassifierUnavailable {
name: String,
reason: String,
},
NoAvailableClassifier {
reason: String,
},
ClassifierBackend {
backend: String,
reason: String,
},
Xml(Error),
Io(Error),
Command(CommandError),
Config(ConfigError),
}Expand description
Error type for MIME repository parsing and I/O backed detection.
Variants§
InvalidGlobWeight
A glob weight was outside the freedesktop MIME range 0..=100.
InvalidMagicMatcher
A magic matcher definition is internally inconsistent.
InvalidXmlAttribute
An XML attribute is missing or malformed.
Fields
InvalidXmlElement
An XML element is missing required content or has invalid children.
InvalidClassifierInput
A detector or classifier input cannot be processed.
DuplicateDetectorName
A detector provider name or alias is already registered.
EmptyDetectorName
A detector provider name or alias is empty.
InvalidDetectorName
A detector provider name or alias is malformed.
UnknownDetector
A detector provider could not be found.
A detector provider exists but is not available in this environment.
NoAvailableDetector
No configured detector provider could be created.
DetectorBackend
A detector backend failed with an implementation-specific error.
DuplicateClassifierName
A media stream classifier provider name or alias is already registered.
EmptyClassifierName
A media stream classifier provider name or alias is empty.
InvalidClassifierName
A media stream classifier provider name or alias is malformed.
UnknownClassifier
A media stream classifier provider could not be found.
A media stream classifier provider exists but is not available in this environment.
NoAvailableClassifier
No configured media stream classifier provider could be created.
ClassifierBackend
A media stream classifier backend failed with an implementation-specific error.
Xml(Error)
The XML document could not be parsed.
Io(Error)
Detection from a path or reader failed due to I/O.
Command(CommandError)
Detection using an external command failed.
Config(ConfigError)
Loading MIME configuration failed.
Implementations§
Trait Implementations§
Source§impl Error for MimeError
impl Error for MimeError
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()
Source§impl From<CommandError> for MimeError
impl From<CommandError> for MimeError
Source§fn from(source: CommandError) -> Self
fn from(source: CommandError) -> Self
Source§impl From<ConfigError> for MimeError
impl From<ConfigError> for MimeError
Source§fn from(source: ConfigError) -> Self
fn from(source: ConfigError) -> Self
Source§impl From<ProviderRegistryError> for MimeError
impl From<ProviderRegistryError> for MimeError
Source§fn from(error: ProviderRegistryError) -> Self
fn from(error: ProviderRegistryError) -> Self
Converts a generic SPI registry error into a MIME-domain error.
Auto Trait Implementations§
impl Freeze for MimeError
impl !RefUnwindSafe for MimeError
impl Send for MimeError
impl Sync for MimeError
impl Unpin for MimeError
impl UnsafeUnpin for MimeError
impl !UnwindSafe for MimeError
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T, D> IntoConfigDefault<T> for Dwhere
D: IntoValueDefault<T>,
impl<T, D> IntoConfigDefault<T> for Dwhere
D: IntoValueDefault<T>,
Source§fn into_config_default(self) -> T
fn into_config_default(self) -> T
T.