Struct syn_inline_mod::InliningResult[][src]

pub struct InliningResult { /* fields omitted */ }
Expand description

The result of a best-effort attempt at inlining.

This struct guarantees that the origin file was readable and valid Rust source code, but errors must be inspected to check if everything was inlined successfully.

Implementations

The best-effort result of inlining.

The errors that kept the inlining from completing. May be empty if there were no errors.

Whether the result has any errors. false implies that all inlining operations completed successfully.

Break an incomplete inlining into the best-effort parsed result and the errors encountered.

Usage
let result = InlinerBuilder::default().parse_and_inline_modules(Path::new("foo.rs"));
match result {
    Err(e) => unimplemented!(),
    Ok(r) if r.has_errors() => {
        let (best_effort, errors) = r.into_output_and_errors();
        // do things with the partial output and the errors
    },
    Ok(r) => {
        let (complete, _) = r.into_output_and_errors();
        // do things with the completed output
    }
}

Trait Implementations

Formats the value using the given formatter. Read more

Formats the value using the given formatter. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

Converts the given value to a String. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.