pub enum LoadError {
NoRules,
UnsupportedFlag {
index: usize,
flag: char,
},
Compile {
index: usize,
reason: CompileError,
},
Precompiled {
reason: CompileError,
},
NearHeader {
line: usize,
},
PreHeaderContent {
line: usize,
},
EmptySection {
line: usize,
},
DuplicateName {
first_line: usize,
line: usize,
},
}Expand description
Re-exports the forbidden-regex rule compiler’s public surface. Re-exports the redacted load-error type as this module’s public failure. A rule-load failure with everything the rule text redacted out.
The compiler fails closed on the first offending rule and reports only its
opaque index plus a reason that echoes no pattern bytes. Debug is derived
because no variant holds rule text, so the derived form is leak-safe too.
Variants§
NoRules
The source held no non-blank, non-comment rule line.
UnsupportedFlag
A regex rule carried a flag letter other than the m/x no-ops.
Fields
Compile
The engine rejected a rule at compile time (bad dialect, empty-matchable, oversized repetition, state-cap blowup).
Fields
reason: CompileErrorEngine’s static reason; its Display echoes no pattern bytes.
Precompiled
A precompiled serialized RegexSet blob failed to decode or validate.
Fields
reason: CompileErrorEngine’s static reason; a codec/validation message, never rule text.
NearHeader
A tail-format line’s trimmed form led with ==> without being exactly a
strict ==> name <== header, so it is a near-header, never absorbed
silently into a section body; genuine arrow-leading content uses the
[=]=> reshape in regex bodies.
PreHeaderContent
A tail-format file carried significant content before its first section header, which the format forbids so no rule can escape a section.
EmptySection
A tail-format section header opened a body with no significant rule line, which is fail-closed rather than a silently dropped section.
DuplicateName
Two tail-format sections declared the same name, which collides the rule identities the format exists to keep unique across the loaded input.
Trait Implementations§
impl Eq for LoadError
Source§impl Error for LoadError
Lets LoadError participate in the standard error ecosystem.
impl Error for LoadError
Lets LoadError participate in the standard error ecosystem.
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()
impl StructuralPartialEq for LoadError
Auto Trait Implementations§
impl Freeze for LoadError
impl RefUnwindSafe for LoadError
impl Send for LoadError
impl Sync for LoadError
impl Unpin for LoadError
impl UnsafeUnpin for LoadError
impl UnwindSafe for LoadError
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<T> ErrorExt for T
impl<T> ErrorExt for T
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