pub enum InitError {
Ambiguous {
symbol: &'static Symbol,
},
Circular {
symbols: Vec<&'static Symbol>,
},
Execution(Error),
}Expand description
Error type returned by init_static() when initialization fails.
This enum represents the various failure modes that can occur during the static initialization process.
Variants§
Ambiguous
A static symbol was defined multiple times.
This typically occurs when the same init_static! block is included multiple times, or
when two statics in different modules have the exact same source location metadata (which
should not happen in normal usage).
Circular
A circular dependency was detected among statics.
This occurs when static A depends on static B, and static B (directly or indirectly) depends on static A. The initialization system cannot determine a valid order to initialize such statics.
Execution(Error)
An initialization expression returned an error.
This wraps any anyhow::Error returned by a static’s initialization expression. The
original error is preserved and can be accessed via the Error::source method.