[][src]Struct capnpc::CompilerCommand

pub struct CompilerCommand { /* fields omitted */ }

A builder object for schema compiler commands.

Methods

impl CompilerCommand[src]

pub fn new() -> CompilerCommand[src]

Creates a new, empty command.

pub fn file<'a, P>(&'a mut self, path: P) -> &'a mut CompilerCommand where
    P: AsRef<Path>, 
[src]

Adds a file to be compiled.

pub fn src_prefix<'a, P>(&'a mut self, prefix: P) -> &'a mut CompilerCommand where
    P: AsRef<Path>, 
[src]

Adds a --src-prefix flag. For all files specified for compilation that start with prefix, removes the prefix when computing output filenames.

pub fn import_path<'a, P>(&'a mut self, dir: P) -> &'a mut CompilerCommand where
    P: AsRef<Path>, 
[src]

Adds an --import_path flag. Adds dir to the list of directories searched for absolute imports.

pub fn no_standard_import<'a>(&'a mut self) -> &'a mut CompilerCommand[src]

Adds the --no-standard-import flag, indicating that the default import paths of /usr/include and /usr/local/include should not bet included.

pub fn edition(&mut self, _rust_edition: RustEdition) -> &mut Self[src]

Deprecated since 0.10.0:

no longer need to specify rust edition

Sets the Rust edition of the generated code.

pub fn output_path<'a, P>(&'a mut self, path: P) -> &'a mut CompilerCommand where
    P: AsRef<Path>, 
[src]

Sets the output directory of generated code. Default is OUT_DIR

pub fn run(&mut self) -> Result<()>[src]

Runs the command. Returns an error if OUT_DIR or a custom output directory was not set or if capnp compile fails.

Auto Trait Implementations

Blanket Implementations

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

impl<T> From<T> for 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.

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

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

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