pub enum DirectiveError {
InvalidDirective {
name: String,
span: Span,
},
InvalidOption {
directive: String,
option: String,
span: Span,
},
InvalidValue {
directive: String,
expected: &'static str,
got: String,
span: Span,
},
ValueOutOfRange {
directive: String,
value: String,
min: String,
max: String,
span: Span,
},
MissingArgument {
directive: String,
expected: usize,
got: usize,
span: Span,
},
TooManyArguments {
directive: String,
expected: usize,
got: usize,
span: Span,
},
}Expand description
Errors specific to a single directive during parsing.
Covers invalid directive names, invalid options, invalid or out-of-range values, and incorrect argument counts.
These errors are typically wrapped in ParseError::Parse when returned from
the top-level parsing API.
Variants§
InvalidDirective
The directive name is not a recognised chrony directive.
InvalidOption
The option is not valid for the given directive. The option is not valid for the given directive.
InvalidValue
The argument value could not be parsed as the expected type.
ValueOutOfRange
A numeric value fell outside the valid range.
MissingArgument
Not enough arguments were provided for the directive.
TooManyArguments
More arguments were provided than the directive expects.
Trait Implementations§
Source§impl Debug for DirectiveError
impl Debug for DirectiveError
Source§impl Display for DirectiveError
impl Display for DirectiveError
Source§impl Error for DirectiveError
impl Error for DirectiveError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0:
use the Display impl or to_string()
Source§impl PartialEq for DirectiveError
impl PartialEq for DirectiveError
Source§fn eq(&self, other: &DirectiveError) -> bool
fn eq(&self, other: &DirectiveError) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for DirectiveError
Auto Trait Implementations§
impl Freeze for DirectiveError
impl RefUnwindSafe for DirectiveError
impl Send for DirectiveError
impl Sync for DirectiveError
impl Unpin for DirectiveError
impl UnsafeUnpin for DirectiveError
impl UnwindSafe for DirectiveError
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
Mutably borrows from an owned value. Read more