pub enum EpubBuilderError {
IllegalManifestPath {
manifest_id: String,
},
ManifestCircularReference {
fallback_chain: String,
},
ManifestNotFound {
manifest_id: String,
},
MissingNecessaryMetadata,
NavigationInfoUninitalized,
MissingRootfile,
TargetIsNotFile {
target_path: String,
},
TooManyNavFlags,
UnknowFileFormat {
file_path: String,
},
}Expand description
Types of errors that can occur during EPUB build
This enumeration defines various error conditions that may occur
when creating EPUB files using the builder function. These errors
are typically related to EPUB specification requirements or validation
rules during the build process.
Variants§
IllegalManifestPath
Illegal manifest path error
This error is triggered when the path corresponding to a resource ID in the manifest begins with “../”. Using relative paths starting with “../” when building the manifest fails to determine the ‘current location’, making it impossible to pinpoint the resource.
ManifestCircularReference
Manifest Circular Reference error
This error is triggered when a fallback relationship between manifest items forms a cycle.
ManifestNotFound
Manifest resource not found error
This error is triggered when a manifest item specifies a fallback resource ID that does not exist.
MissingNecessaryMetadata
Missing necessary metadata error
This error is triggered when the basic metadata required to build a valid EPUB is missing. The following must be included: title, language, and an identifier with a ‘pub-id’ ID.
Navigation information uninitialized error
This error is triggered when attempting to build an EPUB but without setting navigation information.
MissingRootfile
Missing rootfile error
This error is triggered when attempting to build an EPUB without adding any ‘rootfile’.
TargetIsNotFile
Target is not a file error
This error is triggered when the specified target path is not a file.
Too many nav flags error
This error is triggered when the manifest contains multiple items with
the nav attribute. The EPUB specification requires that each EPUB have
only one navigation document.
UnknowFileFormat
Unknown file format error
This error is triggered when the format type of the specified file cannot be analyzed.
Trait Implementations§
Source§impl Debug for EpubBuilderError
impl Debug for EpubBuilderError
Source§impl Display for EpubBuilderError
impl Display for EpubBuilderError
Source§impl Error for EpubBuilderError
impl Error for EpubBuilderError
1.30.0 · 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
Source§impl From<EpubBuilderError> for EpubError
Available on crate feature builder only.
impl From<EpubBuilderError> for EpubError
builder only.