Enum lcov::record::ParseRecordError
source · [−]pub enum ParseRecordError {
FieldNotFound(&'static str),
TooManyFields,
ParseIntError(&'static str, ParseIntError),
UnknownRecord,
}Expand description
All possible errors that can occur when parsing LCOV record.
Variants
FieldNotFound(&'static str)
An error indicating that the field of the record is not found in the input.
Examples
use lcov::Record;
use lcov::record::ParseRecordError;
assert_eq!("FNDA:3".parse::<Record>(), Err(ParseRecordError::FieldNotFound("name")));TooManyFields
An error indicating that the number of fields is larger than expected.
Examples
use lcov::Record;
use lcov::record::ParseRecordError;
assert_eq!("LF:1,2".parse::<Record>(), Err(ParseRecordError::TooManyFields));ParseIntError(&'static str, ParseIntError)
An error indicating that parsing integer field failed.
Examples
use lcov::Record;
use lcov::record::ParseRecordError;
assert_matches!("LH:foo".parse::<Record>(), Err(ParseRecordError::ParseIntError("hit", _)));UnknownRecord
An error indicating that the unknown record is found in the input.
Example
use lcov::Record;
use lcov::record::ParseRecordError;
assert_eq!("FOO:1,2".parse::<Record>(), Err(ParseRecordError::UnknownRecord));Trait Implementations
sourceimpl Clone for ParseRecordError
impl Clone for ParseRecordError
sourcefn clone(&self) -> ParseRecordError
fn clone(&self) -> ParseRecordError
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source. Read more
sourceimpl Debug for ParseRecordError
impl Debug for ParseRecordError
sourceimpl Display for ParseRecordError
impl Display for ParseRecordError
sourceimpl Error for ParseRecordError
impl Error for ParseRecordError
sourcefn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
The lower-level source of this error, if any. Read more
sourcefn backtrace(&self) -> Option<&Backtrace>
fn backtrace(&self) -> Option<&Backtrace>
🔬 This is a nightly-only experimental API. (
backtrace)Returns a stack backtrace, if available, of where this error occurred. Read more
1.0.0 · sourcefn description(&self) -> &str
fn description(&self) -> &str
👎 Deprecated since 1.42.0:
use the Display impl or to_string()
sourceimpl PartialEq<ParseRecordError> for ParseRecordError
impl PartialEq<ParseRecordError> for ParseRecordError
sourcefn eq(&self, other: &ParseRecordError) -> bool
fn eq(&self, other: &ParseRecordError) -> bool
This method tests for self and other values to be equal, and is used
by ==. Read more
sourcefn ne(&self, other: &ParseRecordError) -> bool
fn ne(&self, other: &ParseRecordError) -> bool
This method tests for !=.
impl Eq for ParseRecordError
impl StructuralEq for ParseRecordError
impl StructuralPartialEq for ParseRecordError
Auto Trait Implementations
impl RefUnwindSafe for ParseRecordError
impl Send for ParseRecordError
impl Sync for ParseRecordError
impl Unpin for ParseRecordError
impl UnwindSafe for ParseRecordError
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more