pub enum ExpandError {
Restage(Box<RestageError<ExpandError>>),
Build(NodeBuildError),
BadPlaceholder {
reference: String,
},
Hook {
detail: String,
},
}Expand description
A failure of an Expand implementation, or of the Expander it works
through: the error type of the expand pass’s traversal. The boxed
Restage variant follows techy’s pattern for errors
of a recursive traversal.
Every variant is an implementation failure, never a problem in the document:
a problem in the document is reported as a diagnostic, and the use site is
replaced by its literal source text (Expander::recover). An
ExpandError that reaches the pass ends it with no tree, reported as
flm.userdefs.expansion-failed, or as flm.blocks.nesting-too-deep for a
refusal of the recursion guard (ExpandFailure).
Variants§
Restage(Box<RestageError<ExpandError>>)
An operation of the restage context failed: a region of a node could not be attached to its new nodes, the recursion guard refused, or a node could not be built.
Build(NodeBuildError)
Building a node directly through the context’s node builder failed.
BadPlaceholder
A placeholder that the placeholder bindings could not give a value. The
substitution pass returns it, and Expander::instantiate turns it into the
use site’s recovery; an implementation receives this error only if it
instantiates a template by other means.
Hook
A failure of the implementation’s own code (an operational error in extension code).
Implementations§
Source§impl ExpandError
impl ExpandError
Sourcepub fn descent_refusal(&self) -> Option<&str>
pub fn descent_refusal(&self) -> Option<&str>
The detail of a refusal of the recursion guard, when this error, or a restage error it wraps at any depth, is one.
Sourcepub fn bad_placeholder(&self) -> Option<&str>
pub fn bad_placeholder(&self) -> Option<&str>
The placeholder that could not be given a value, when this error is a
BadPlaceholder or wraps one, at any depth,
inside a restage error. A placeholder inside a conditional’s branch or inside
a default value reaches the pass through the restage driver’s own wrapping.
Trait Implementations§
Source§impl Debug for ExpandError
impl Debug for ExpandError
Source§impl Display for ExpandError
impl Display for ExpandError
Source§impl Error for ExpandError
impl Error for ExpandError
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()
Source§impl From<NodeBuildError> for ExpandError
impl From<NodeBuildError> for ExpandError
Source§fn from(error: NodeBuildError) -> ExpandError
fn from(error: NodeBuildError) -> ExpandError
Source§impl From<RestageError<ExpandError>> for ExpandError
impl From<RestageError<ExpandError>> for ExpandError
Source§fn from(error: RestageError<ExpandError>) -> ExpandError
fn from(error: RestageError<ExpandError>) -> ExpandError
Auto Trait Implementations§
impl Forget for ExpandError
impl Freeze for ExpandErrorwhere
*const RestageError<ExpandError> is !null: Freeze,
PhantomData<RestageError<ExpandError>>: Freeze,
*const u8 is !null: Freeze,
PhantomData<u8>: Freeze,
&'static str: Freeze,
impl Move for ExpandError
impl RefUnwindSafe for ExpandError
impl Send for ExpandError
impl Sync for ExpandError
impl Unpin for ExpandError
impl UnsafeUnpin for ExpandErrorwhere
*const RestageError<ExpandError> is !null: UnsafeUnpin,
PhantomData<RestageError<ExpandError>>: UnsafeUnpin,
*const u8 is !null: UnsafeUnpin,
PhantomData<u8>: UnsafeUnpin,
&'static str: UnsafeUnpin,
impl UnwindSafe for ExpandErrorwhere
BoxRaw<RestageError<ExpandError>>: UnwindSafe,
RawVecInner: UnwindSafe,
&'static str: UnwindSafe,
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CheckedAs for T
impl<T> CheckedAs for T
Source§fn checked_as<Dst>(self) -> Option<Dst>where
T: CheckedCast<Dst>,
fn checked_as<Dst>(self) -> Option<Dst>where
T: CheckedCast<Dst>,
Source§impl<Src, Dst> CheckedCastFrom<Src> for Dstwhere
Src: CheckedCast<Dst>,
impl<Src, Dst> CheckedCastFrom<Src> for Dstwhere
Src: CheckedCast<Dst>,
Source§fn checked_cast_from(src: Src) -> Option<Dst>
fn checked_cast_from(src: Src) -> Option<Dst>
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