pub enum IncludeError {
Cycle {
include_site: Range,
path: PathBuf,
chain: Vec<PathBuf>,
},
DepthExceeded {
include_site: Range,
limit: usize,
chain: Vec<PathBuf>,
},
RootEscape {
path: PathBuf,
root: PathBuf,
},
NotFound {
include_site: Range,
path: PathBuf,
},
ParseFailed {
path: PathBuf,
message: String,
},
ContainerPolicy {
include_site: Range,
container: &'static str,
file: PathBuf,
violation: &'static str,
},
LoaderIo {
path: PathBuf,
message: String,
},
MissingSrc {
include_site: Range,
},
}Expand description
Errors the include resolver can produce.
Variants§
Cycle
An include chain looped back on itself. chain is the resolution
stack at the moment the duplicate path was about to be pushed,
in source-order (entry first, deepest last). include_site is the
range of the offending lex.include annotation in its host file —
useful for diagnostics that highlight the exact line.
DepthExceeded
The include depth exceeded ResolveConfig::max_depth. chain
shows the resolution stack at the moment of failure, in source
order. include_site is the range of the offending
lex.include annotation in its host file.
RootEscape
A path resolved outside the configured ResolveConfig::root.
NotFound
The loader could not find or read the included file. include_site
is the range of the offending lex.include annotation in its host
file, so editors can squiggle the line that asked for the missing
file rather than the document head.
ParseFailed
The loader returned text that the parser rejected.
ContainerPolicy
The included file’s content is not legal in the include site’s parent container.
Today this only occurs when an included file has top-level Sessions
and the include site is inside a GeneralContainer (Definition,
ListItem, or another Annotation’s body). The violation field
names the offending content kind (e.g. "Sessions") so future
container/policy combinations can reuse this variant without a
breaking change.
LoaderIo
Loader propagated a non-NotFound I/O error.
MissingSrc
lex.include annotation was missing the mandatory src= parameter.
Trait Implementations§
Source§impl Clone for IncludeError
impl Clone for IncludeError
Source§fn clone(&self) -> IncludeError
fn clone(&self) -> IncludeError
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for IncludeError
impl Debug for IncludeError
Source§impl Display for IncludeError
impl Display for IncludeError
Source§impl Error for IncludeError
impl Error for IncludeError
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
use the Display impl or to_string()
Auto Trait Implementations§
impl Freeze for IncludeError
impl RefUnwindSafe for IncludeError
impl Send for IncludeError
impl Sync for IncludeError
impl Unpin for IncludeError
impl UnsafeUnpin for IncludeError
impl UnwindSafe for IncludeError
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more