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 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
}
}