pub enum MergeError {
UnmatchedFunctionLine,
UnmatchedChecksum,
}Expand description
All possible errors that can occur when merging LCOV records.
Variants§
UnmatchedFunctionLine
An error indicating that start line of functions are not same.
This error occurs when merging not compatible LCOV tracefiles.
§Examples
use lcov::{Reader, Report};
use lcov::report::MergeError;
let input1 = "\
TN:test_name
SF:foo.c
FN:3,foo
end_of_record
";
let input2 = "\
TN:test_name
SF:foo.c
FN:4,foo
end_of_record
";
let mut report1 = Report::from_reader(Reader::new(input1.as_bytes()))?;
let report2 = Report::from_reader(Reader::new(input2.as_bytes()))?;
assert_matches!(report1.merge(report2),
Err(MergeError::UnmatchedFunctionLine));UnmatchedChecksum
An error indicating that checksum of lines are not same.
This error occurs when merging not compatible LCOV tracefiles.
§Examples
use lcov::{Reader, Report};
use lcov::report::MergeError;
let input1 = "\
TN:test_name
SF:foo.c
DA:4,1,valid_checksum
end_of_record
";
let input2 = "\
TN:test_name
SF:foo.c
DA:4,4,invalid_checksum
end_of_record
";
let mut report1 = Report::from_reader(Reader::new(input1.as_bytes()))?;
let report2 = Report::from_reader(Reader::new(input2.as_bytes()))?;
assert_matches!(report1.merge(report2),
Err(MergeError::UnmatchedChecksum));Trait Implementations§
Source§impl Clone for MergeError
impl Clone for MergeError
Source§fn clone(&self) -> MergeError
fn clone(&self) -> MergeError
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for MergeError
impl Debug for MergeError
Source§impl Display for MergeError
impl Display for MergeError
Source§impl Error for MergeError
impl Error for MergeError
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 MergeError
impl PartialEq for MergeError
impl Copy for MergeError
impl Eq for MergeError
impl StructuralPartialEq for MergeError
Auto Trait Implementations§
impl Freeze for MergeError
impl RefUnwindSafe for MergeError
impl Send for MergeError
impl Sync for MergeError
impl Unpin for MergeError
impl UnwindSafe for MergeError
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