pub enum ProfileError {
EmptyName,
NoCommentDelimiter,
EmptyDelimiter(&'static str),
AmbiguousDelimiter(String, String),
AmbiguousStringDelimiter(String, String),
CommentStringCollision(String, String),
InvalidNesting,
NewlineDelimiter,
EmptyProtectedPattern,
InvalidPolicyRegex(String),
}Expand description
Why a DeclarativeProfile cannot be interpreted.
Every variant is a limit of the single-pass design rather than a passing problem with the input, so the same profile always fails the same way.
Variants§
EmptyName
The profile has no name to put in a diagnostic.
NoCommentDelimiter
The profile declares neither a line nor a block comment.
EmptyDelimiter(&'static str)
The named token is the empty string, which would match everywhere.
AmbiguousDelimiter(String, String)
Two comment delimiters where one is a prefix of the other.
AmbiguousStringDelimiter(String, String)
Two string delimiters where one is a prefix of the other.
CommentStringCollision(String, String)
A comment delimiter and a string delimiter where one is a prefix of the other, so one position could open either.
InvalidNesting
A nested block whose start and end are equal or overlap, which no depth count can read.
NewlineDelimiter
A delimiter spanning a line terminator, which a one-line token cannot.
EmptyProtectedPattern
A ProtectedPattern with nothing to look for or no reason to give.
InvalidPolicyRegex(String)
A keep_regex or remove_regex entry of the ScanOptions would not
compile.
Trait Implementations§
Source§impl Clone for ProfileError
impl Clone for ProfileError
Source§fn clone(&self) -> ProfileError
fn clone(&self) -> ProfileError
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ProfileError
impl Debug for ProfileError
Source§impl Display for ProfileError
impl Display for ProfileError
impl Eq for ProfileError
Source§impl Error for ProfileError
impl Error for ProfileError
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()