[−][src]Struct syn_inline_mod::InliningResult
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
impl !RefUnwindSafe for InliningResult
impl !Send for InliningResult
impl !Sync for InliningResult
impl Unpin for InliningResult
impl !UnwindSafe for InliningResult
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,