Skip to main content

ParseError

Enum ParseError 

Source
#[non_exhaustive]
pub enum ParseError {
Show 17 variants NotUtf8 { what: &'static str, nuls: usize, }, NoInvocations, UnbalancedQuoting { line: String, }, NoUnitData, MalformedArray { name: String, detail: String, }, TruncatedArray { name: String, }, BadUnitField { entry: usize, field: &'static str, expected: &'static str, }, NoSummaryTable, MissingSummaryRow { row: &'static str, }, BadSummaryRow { row: &'static str, value: String, expected: &'static str, }, FreshUnits { fresh: usize, total: usize, }, EmptyBuild, DurationOutOfRange { entry: usize, seconds: f64, }, UnmatchedUnits { in_log: Vec<UnitDescription>, in_report: Vec<UnitDescription>, had_metadata: bool, }, UnresolvedDependency { consumer: Box<UnitDescription>, dependency: String, producer: String, }, Metadata { detail: String, }, Graph(GraphError),
}
Expand description

A build’s output that could not be turned into a graph, and why.

Every variant’s message states what to do next, because the usual cause is that the build the output came from was not the kind of build the analysis needs.

Variants (Non-exhaustive)§

This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

NotUtf8

The input holds NUL characters, so it is not the UTF-8 text Cargo wrote.

Fields

§what: &'static str

What was being read, for the message: build log or timing report.

§nuls: usize

How many NUL characters were found.

§

NoInvocations

The verbose log contained no compiler invocations at all.

§

UnbalancedQuoting

A Running line could not be split into arguments because a quote was left open.

Fields

§line: String

The offending line, truncated.

§

NoUnitData

The timing report contained no UNIT_DATA array.

§

MalformedArray

A JavaScript array literal in the timing report was not valid JSON.

Fields

§name: String

The name of the assignment, such as UNIT_DATA.

§detail: String

What serde_json said about it.

§

TruncatedArray

An array literal in the timing report was cut off before its closing bracket.

Fields

§name: String

The name of the assignment, such as UNIT_DATA.

§

BadUnitField

A UNIT_DATA entry was missing a field, or the field had the wrong type.

Fields

§entry: usize

Which entry, counted from zero as the report numbers them.

§field: &'static str

The field that was wrong.

§expected: &'static str

What was expected of it.

§

NoSummaryTable

The timing report’s summary table was absent or unreadable.

§

MissingSummaryRow

The timing report’s summary table lacked a row the analysis needs.

Fields

§row: &'static str

The row’s label, as Cargo writes it.

§

BadSummaryRow

A summary row was present but did not hold the expected kind of value.

Fields

§row: &'static str

The row’s label, as Cargo writes it.

§value: String

What the row actually contained.

§expected: &'static str

What was expected of it.

§

FreshUnits

The build reused cached units, so most of its weights are zero.

Fields

§fresh: usize

How many units were reused.

§total: usize

How many units the build had in total.

§

EmptyBuild

The build compiled nothing.

§

DurationOutOfRange

A duration in the timing report is not a duration.

Fields

§entry: usize

Which entry, counted from zero.

§seconds: f64

The value that could not be used.

§

UnmatchedUnits

The two inputs describe different sets of units.

Fields

§in_log: Vec<UnitDescription>

Units the verbose log has and the timing report does not.

§in_report: Vec<UnitDescription>

Units the timing report has and the verbose log does not.

§had_metadata: bool

Whether cargo metadata output was supplied.

§

UnresolvedDependency

A --extern names an artifact no invocation in this log produced.

Fields

§consumer: Box<UnitDescription>

The unit that named it, boxed so that a failure path does not widen every Result in the crate.

§dependency: String

The --extern name.

§producer: String

The artifact path’s producer hash, where there was one.

§

Metadata

cargo metadata output could not be read.

Fields

§detail: String

What was wrong with it.

§

Graph(GraphError)

The assembled graph was rejected by the core.

Trait Implementations§

Source§

impl Clone for ParseError

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for ParseError

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Display for ParseError

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Error for ParseError

Source§

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

👎Deprecated since 1.42.0:

use the Display impl or to_string()

1.0.0 · Source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0:

replaced by Error::source, which can support downcasting

Source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type-based access to context intended for error reports. Read more
Source§

impl From<GraphError> for ParseError

Source§

fn from(inner: GraphError) -> Self

Converts to this type from the input type.
Source§

impl PartialEq for ParseError

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for ParseError

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.