pub struct MetarError<'a> {
pub string: &'a str,
pub start: usize,
pub end: usize,
pub variant: ErrorVariant,
}Expand description
An error when parsing a METAR
Fields§
§string: &'a strThe string being parsed
start: usizeThe start index of the error
end: usizeThe length of the error’d section
variant: ErrorVariantThe kind of error that occurred
Implementations§
Source§impl MetarError<'_>
impl MetarError<'_>
Sourcepub fn into_owned(&self) -> OwnedMetarError
pub fn into_owned(&self) -> OwnedMetarError
Convert this error into an OwnedMetarError
Trait Implementations§
Source§impl<'a> Clone for MetarError<'a>
impl<'a> Clone for MetarError<'a>
Source§fn clone(&self) -> MetarError<'a>
fn clone(&self) -> MetarError<'a>
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<'a> Debug for MetarError<'a>
impl<'a> Debug for MetarError<'a>
Source§impl Display for MetarError<'_>
impl Display for MetarError<'_>
impl<'a> Eq for MetarError<'a>
Source§impl Error for MetarError<'_>
impl Error for MetarError<'_>
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<'a> Error<'a, &'a str> for MetarError<'a>
impl<'a> Error<'a, &'a str> for MetarError<'a>
Source§impl<'a> LabelError<'a, &'a str, DefaultExpected<'a, char>> for MetarError<'a>
impl<'a> LabelError<'a, &'a str, DefaultExpected<'a, char>> for MetarError<'a>
Source§fn expected_found<E: IntoIterator<Item = DefaultExpected<'a, char>>>(
expected: E,
found: Option<MaybeRef<'a, char>>,
span: SimpleSpan,
) -> Self
fn expected_found<E: IntoIterator<Item = DefaultExpected<'a, char>>>( expected: E, found: Option<MaybeRef<'a, char>>, span: SimpleSpan, ) -> Self
Create a new error describing a conflict between expected inputs and that which was actually found. Read more
Source§fn merge_expected_found<E>(
self,
expected: E,
found: Option<Maybe<<I as Input<'src>>::Token, &'src <I as Input<'src>>::Token>>,
span: <I as Input<'src>>::Span,
) -> Selfwhere
E: IntoIterator<Item = L>,
Self: Error<'src, I>,
fn merge_expected_found<E>(
self,
expected: E,
found: Option<Maybe<<I as Input<'src>>::Token, &'src <I as Input<'src>>::Token>>,
span: <I as Input<'src>>::Span,
) -> Selfwhere
E: IntoIterator<Item = L>,
Self: Error<'src, I>,
Fast path for
a.merge(LabelError::expected_found(...)) that may incur less overhead by, for example, reusing allocations.Source§fn replace_expected_found<E>(
self,
expected: E,
found: Option<Maybe<<I as Input<'src>>::Token, &'src <I as Input<'src>>::Token>>,
span: <I as Input<'src>>::Span,
) -> Selfwhere
E: IntoIterator<Item = L>,
fn replace_expected_found<E>(
self,
expected: E,
found: Option<Maybe<<I as Input<'src>>::Token, &'src <I as Input<'src>>::Token>>,
span: <I as Input<'src>>::Span,
) -> Selfwhere
E: IntoIterator<Item = L>,
Fast path for
a = LabelError::expected_found(...) that may incur less overhead by, for example, reusing allocations.Source§fn label_with(&mut self, label: L)
fn label_with(&mut self, label: L)
Annotate the expected patterns within this parser with the given label. Read more
Source§impl<'a> LabelError<'a, &'a str, TextExpected<()>> for MetarError<'a>
impl<'a> LabelError<'a, &'a str, TextExpected<()>> for MetarError<'a>
Source§fn expected_found<E: IntoIterator<Item = TextExpected<()>>>(
expected: E,
found: Option<MaybeRef<'a, char>>,
span: SimpleSpan,
) -> Self
fn expected_found<E: IntoIterator<Item = TextExpected<()>>>( expected: E, found: Option<MaybeRef<'a, char>>, span: SimpleSpan, ) -> Self
Create a new error describing a conflict between expected inputs and that which was actually found. Read more
Source§fn merge_expected_found<E>(
self,
expected: E,
found: Option<Maybe<<I as Input<'src>>::Token, &'src <I as Input<'src>>::Token>>,
span: <I as Input<'src>>::Span,
) -> Selfwhere
E: IntoIterator<Item = L>,
Self: Error<'src, I>,
fn merge_expected_found<E>(
self,
expected: E,
found: Option<Maybe<<I as Input<'src>>::Token, &'src <I as Input<'src>>::Token>>,
span: <I as Input<'src>>::Span,
) -> Selfwhere
E: IntoIterator<Item = L>,
Self: Error<'src, I>,
Fast path for
a.merge(LabelError::expected_found(...)) that may incur less overhead by, for example, reusing allocations.Source§fn replace_expected_found<E>(
self,
expected: E,
found: Option<Maybe<<I as Input<'src>>::Token, &'src <I as Input<'src>>::Token>>,
span: <I as Input<'src>>::Span,
) -> Selfwhere
E: IntoIterator<Item = L>,
fn replace_expected_found<E>(
self,
expected: E,
found: Option<Maybe<<I as Input<'src>>::Token, &'src <I as Input<'src>>::Token>>,
span: <I as Input<'src>>::Span,
) -> Selfwhere
E: IntoIterator<Item = L>,
Fast path for
a = LabelError::expected_found(...) that may incur less overhead by, for example, reusing allocations.Source§fn label_with(&mut self, label: L)
fn label_with(&mut self, label: L)
Annotate the expected patterns within this parser with the given label. Read more
Source§impl<'a> PartialEq for MetarError<'a>
impl<'a> PartialEq for MetarError<'a>
Source§fn eq(&self, other: &MetarError<'a>) -> bool
fn eq(&self, other: &MetarError<'a>) -> bool
Tests for
self and other values to be equal, and is used by ==.impl<'a> StructuralPartialEq for MetarError<'a>
Auto Trait Implementations§
impl<'a> Freeze for MetarError<'a>
impl<'a> RefUnwindSafe for MetarError<'a>
impl<'a> Send for MetarError<'a>
impl<'a> Sync for MetarError<'a>
impl<'a> Unpin for MetarError<'a>
impl<'a> UnsafeUnpin for MetarError<'a>
impl<'a> UnwindSafe for MetarError<'a>
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
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
Compare self to
key and return true if they are equal.impl<T> OrderedSeq<'_, T> for Twhere
T: Clone,
Source§impl<'p, T> Seq<'p, T> for Twhere
T: Clone,
impl<'p, T> Seq<'p, T> for Twhere
T: Clone,
Source§impl<T, S> SpanWrap<S> for Twhere
S: WrappingSpan<T>,
impl<T, S> SpanWrap<S> for Twhere
S: WrappingSpan<T>,
Source§fn with_span(self, span: S) -> <S as WrappingSpan<Self>>::Spanned
fn with_span(self, span: S) -> <S as WrappingSpan<Self>>::Spanned
Invokes
WrappingSpan::make_wrapped to wrap an AST node in a span.