pub enum AccessControlSelectorParseError {
NoAccessControlSelectorIdentifierFound {
expected: String,
access_control_selector_string: String,
},
IncorrectAccessControlSelectorIdentifier {
expected: String,
found: String,
access_control_selector_string: String,
},
InvalidAccessControlSelectorIdentifier {
found: Option<String>,
expected: &'static [&'static str],
access_control_selector_string: String,
},
NoClosingBraceFound {
access_control_selector_string: String,
},
InvalidNumberOfFields {
found: usize,
maximum_expected: usize,
access_control_selector_string: String,
},
FailedToParseFieldValue {
field_ident: String,
field_value: String,
error: Box<dyn Error + Send + Sync>,
},
}Expand description
Enumerates the ways parsing an access control selector string can fail.
Each variant captures the original input string together with contextual information about what went wrong, so that error messages can be actionable and specific.
Variants§
NoAccessControlSelectorIdentifierFound
The input string could not be split into an identifier portion at all.
This typically means the string was empty or otherwise malformed in a way that prevented even the first token from being extracted.
Fields
IncorrectAccessControlSelectorIdentifier
The identifier was successfully extracted but does not match the target struct’s name.
Returned when parsing into a specific selector type (e.g.,
"Write".parse::<Read>()) where the identifier does not agree with the
struct being parsed into.
Fields
InvalidAccessControlSelectorIdentifier
The identifier does not match any known selector variant in the
AccessControlSelector enum.
Returned when parsing through the umbrella enum and the leading token is not recognized.
Fields
NoClosingBraceFound
A ( was found but the matching ) was missing.
InvalidNumberOfFields
The number of dot-separated fields inside the parentheses exceeds the maximum that the target struct declares.
Fields
FailedToParseFieldValue
An individual field value inside the parentheses could not be parsed into its target type.
Trait Implementations§
Source§impl Error for AccessControlSelectorParseError
impl Error for AccessControlSelectorParseError
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()