[][src]Struct syn_inline_mod::InlinerBuilder

pub struct InlinerBuilder { /* fields omitted */ }

A builder that can configure how to inline modules.

After creating a builder, set configuration options using the methods taking &mut self, then parse and inline one or more files using parse_and_inline_modules.

Methods

impl InlinerBuilder[src]

pub fn new() -> Self[src]

Create a new InlinerBuilder with the default options.

pub fn root(&mut self, root: bool) -> &mut Self[src]

Configures whether the module being parsed is a root module or not.

A root module is one that is passed directly to rustc. A non-root module is one that is included from another module using a mod item.

Default: true.

pub fn error_not_found(&mut self, error_not_found: bool) -> &mut Self[src]

Configures whether unexpanded modules (due to a missing file) will lead to an Err return value or not.

Default: false.

pub fn parse_and_inline_modules(&self, src_file: &Path) -> Result<File, Error>[src]

Parse the source code in src_file and return a syn::File that has all modules recursively inlined.

Trait Implementations

impl Debug for InlinerBuilder[src]

impl Default for InlinerBuilder[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, 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.