Struct ParseResultWithIssues

Source
pub struct ParseResultWithIssues<T> {
    pub result: ParseResult<T>,
    pub issues: Vec<ParseIssue>,
}
Expand description

Parse result with accumulated issues for partial recovery

Allows parsing to continue even when encountering recoverable errors, collecting issues for later review while still producing a usable result. Essential for editor integration and robust script processing.

Fields§

§result: ParseResult<T>

The parsed result (if successful)

§issues: Vec<ParseIssue>

Accumulated parse issues from warnings to recoverable errors

Implementations§

Source§

impl<T> ParseResultWithIssues<T>

Source

pub const fn ok(value: T) -> Self

Create successful result with no issues

§Arguments
  • value - The successfully parsed value
§Returns

Result containing the value with empty issues list

Source

pub const fn err(error: ParseError) -> Self

Create error result with no issues

§Arguments
  • error - The parse error that occurred
§Returns

Result containing the error with empty issues list

Source

pub const fn with_issues( result: ParseResult<T>, issues: Vec<ParseIssue>, ) -> Self

Create result with pre-collected issues

§Arguments
  • result - The parse result (success or failure)
  • issues - List of issues encountered during parsing
§Returns

Result with the provided issues attached

Source

pub fn add_issue(self, issue: ParseIssue) -> Self

Add issue to existing result

§Arguments
  • issue - Parse issue to add to the collection
§Returns

Self with the issue added to the issues list

Source

pub fn critical_issues(&self) -> Vec<&ParseIssue>

Get only critical issues from the collection

Critical issues indicate serious problems that will likely affect rendering or script functionality.

§Returns

Vector of references to critical issues only

Source

pub fn has_blocking_issues(&self) -> bool

Check if result has any blocking issues

Blocking issues are those that should prevent further processing or indicate fundamental problems with the script.

§Returns

True if any issue is marked as blocking

Source

pub fn count_by_severity(&self, severity: IssueSeverity) -> usize

Get issue count by severity level

§Arguments
  • severity - The severity level to count
§Returns

Number of issues with the specified severity

Source

pub const fn is_ok(&self) -> bool

Check if parsing was successful (ignoring issues)

§Returns

True if the main result is Ok, regardless of issues

Source

pub const fn is_err(&self) -> bool

Check if parsing failed with an error

§Returns

True if the main result is Err

Trait Implementations§

Source§

impl<T: Clone> Clone for ParseResultWithIssues<T>

Source§

fn clone(&self) -> ParseResultWithIssues<T>

Returns a duplicate of the value. Read more
1.0.0 · Source§

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

Performs copy-assignment from source. Read more
Source§

impl<T: Debug> Debug for ParseResultWithIssues<T>

Source§

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

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

impl<T> From<Result<T, ParseError>> for ParseResultWithIssues<T>

Source§

fn from(result: ParseResult<T>) -> Self

Convert a simple ParseResult into a ParseResultWithIssues

Creates a result with no accumulated issues.

Source§

impl<T> From<T> for ParseResultWithIssues<T>

Source§

fn from(value: T) -> Self

Convert a value into a successful ParseResultWithIssues

Creates an Ok result with no accumulated issues.

Auto Trait Implementations§

§

impl<T> Freeze for ParseResultWithIssues<T>
where T: Freeze,

§

impl<T> RefUnwindSafe for ParseResultWithIssues<T>
where T: RefUnwindSafe,

§

impl<T> Send for ParseResultWithIssues<T>
where T: Send,

§

impl<T> Sync for ParseResultWithIssues<T>
where T: Sync,

§

impl<T> Unpin for ParseResultWithIssues<T>
where T: Unpin,

§

impl<T> UnwindSafe for ParseResultWithIssues<T>
where T: UnwindSafe,

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<!> for T

Source§

fn from(t: !) -> T

Converts to this type from the input type.
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, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.