#[non_exhaustive]pub enum IncludeResolution {
Found(IncludeContent),
NotFound,
NotReadable,
NotDecodable,
}Expand description
The outcome of an IncludeFileHandler::resolve_target call: either the
resolved content, or the reason resolution failed.
The failure reasons map to distinct warnings – mirroring Asciidoctor, which
distinguishes a missing include file (include file not found) from one
that is present but unreadable (include file not readable) or present but
not valid UTF-8 (invalid byte sequence in UTF-8).
This enum is non_exhaustive: future resolution reasons may be recognized
as the parser grows, so a host matching on it needs a catch-all arm. New
variants can still be returned by an IncludeFileHandler implementation.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Found(IncludeContent)
The include file was resolved; its content is carried here.
NotFound
No file could be found for the directive’s target. The parser records a
WarningType::IncludeFileNotFound warning.
NotReadable
A file was found for the directive’s target but could not be read (for
example a permission or other IO error). The parser records a
WarningType::IncludeFileNotReadable warning.
NotDecodable
A file was found and read for the directive’s target but is not valid
UTF-8, and the handler was unable to transcode it (no encoding
attribute, or one it does not support). The parser records a
WarningType::IncludeFileNotDecodable warning.
See the # Encoding section of IncludeFileHandler::resolve_target
for how a handler that can transcode should instead return
IncludeContent::transcoded.
Trait Implementations§
Source§impl Clone for IncludeResolution
impl Clone for IncludeResolution
Source§fn clone(&self) -> IncludeResolution
fn clone(&self) -> IncludeResolution
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more