#[non_exhaustive]pub enum ImportError<E> {
Write {
path: Utf8PathBuf,
source: Error,
},
Config(ModProjectError),
Cancelled,
Refused(ConfigRefusal),
Format(E),
}Expand description
Failure to import a packaged mod as a mod project.
The variants here are the driver’s: they can occur whatever format is being
imported. Format-specific failures arrive through the transparent
Format variant, so matching on a concrete format’s error is
one level deep: ImportError::Format(inner).
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Write
A directory could not be created under the output directory.
Config(ModProjectError)
The imported project’s mod.config.json could not be written.
Cancelled
The cancellation given to
with_cancellation answered
true. The output directory holds however much of the project had been
written, and removing it is the caller’s.
Refused(ConfigRefusal)
The config hook given to
try_with_config refused the project
the archive described.
The output directory holds the content the format extracted, as it does after a cancellation: the hook judges what was decoded, so it can only answer once the format has run. Removing the directory is the caller’s.
The reason is the caller’s own error, boxed. A caller that wants its type
back downcasts: error.downcast_ref::<MyError>().
Format(E)
The format failed to decode the archive; see the format’s own error type for the cases.
Trait Implementations§
Source§impl<E: Debug> Debug for ImportError<E>
impl<E: Debug> Debug for ImportError<E>
Source§impl<E> Display for ImportError<E>where
E: Display,
impl<E> Display for ImportError<E>where
E: Display,
Source§impl<E> Error for ImportError<E>
impl<E> Error for ImportError<E>
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()