[][src]Struct syn_inline_mod::InliningResult

pub struct InliningResult { /* fields omitted */ }

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

impl InliningResult[src]

pub fn output(&self) -> &File[src]

The best-effort result of inlining.

pub fn errors(&self) -> &[InlineError][src]

The errors that kept the inlining from completing. This is guaranteed not to be empty.

pub fn has_errors(&self) -> bool[src]

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

pub fn into_output_and_errors(self) -> (File, Vec<InlineError>)[src]

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

Usage

This example is not tested
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

impl Debug for InliningResult[src]

impl Display for InliningResult[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.