#[non_exhaustive]pub struct Error {
pub(crate) kind: NetdocErrorKind,
msg: Option<Cow<'static, str>>,
pos: Pos,
source: Option<NetdocErrorSource>,
}Expand description
An error that occurred while parsing a directory object of some kind.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.kind: NetdocErrorKindWhat kind of error occurred?
msg: Option<Cow<'static, str>>Do we have more information about the error?>
pos: PosWhere did the error occur?
source: Option<NetdocErrorSource>Was this caused by another error?
Implementations§
Source§impl Error
impl Error
Sourcepub fn within(self, s: &str) -> Error
pub fn within(self, s: &str) -> Error
Return a new error based on this one, with any byte-based position mapped to some line within a string.
Sourcepub fn at_pos(self, p: Pos) -> Error
pub fn at_pos(self, p: Pos) -> Error
Return a new error based on this one, with the position (if any) replaced by ‘p’.
Sourcepub fn or_at_pos(self, p: Pos) -> Error
pub fn or_at_pos(self, p: Pos) -> Error
Return a new error based on this one, with the position (if replaced by ‘p’ if it had no position before.
Sourcepub(crate) fn with_msg<T>(self, message: T) -> Error
pub(crate) fn with_msg<T>(self, message: T) -> Error
Return a new error based on this one, with the message value set to a provided static string.
Sourcepub(crate) fn with_source<T>(self, source: T) -> Errorwhere
T: Into<NetdocErrorSource>,
pub(crate) fn with_source<T>(self, source: T) -> Errorwhere
T: Into<NetdocErrorSource>,
Return a new error based on this one, with the source-error value set to the provided error.
Sourcepub fn netdoc_error_kind(&self) -> NetdocErrorKind
pub fn netdoc_error_kind(&self) -> NetdocErrorKind
Return the NetdocErrorKind of this error.
Trait Implementations§
Source§impl Error for Error
impl Error for Error
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()
Source§impl From<AddrParseError> for Error
impl From<AddrParseError> for Error
Source§fn from(source: AddrParseError) -> Error
fn from(source: AddrParseError) -> Error
Source§impl From<Error> for BuildError
impl From<Error> for BuildError
Source§impl From<ParseIntError> for Error
impl From<ParseIntError> for Error
Source§fn from(source: ParseIntError) -> Error
fn from(source: ParseIntError) -> Error
Source§impl From<PolicyError> for Error
impl From<PolicyError> for Error
Source§fn from(source: PolicyError) -> Error
fn from(source: PolicyError) -> Error
Source§impl From<TimeValidityError> for Error
impl From<TimeValidityError> for Error
Source§fn from(source: TimeValidityError) -> Error
fn from(source: TimeValidityError) -> Error
Auto Trait Implementations§
impl Freeze for Error
impl !RefUnwindSafe for Error
impl Send for Error
impl Sync for Error
impl Unpin for Error
impl UnsafeUnpin for Error
impl !UnwindSafe for Error
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be
downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further
downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSend for T
impl<T> DowncastSend for T
Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<E> ErrorReport for Ewhere
E: Error + 'static,
impl<E> ErrorReport for Ewhere
E: Error + 'static,
Source§fn report(&self) -> Report<ReportHelper<'_>>
fn report(&self) -> Report<ReportHelper<'_>>
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