pub struct CompileCommand { /* private fields */ }Expand description
A builder for compiling Cap’n Proto schemas into a CodeGeneratorRequest.
The builder options mirror the corresponding capnp compile flags. Options
that concern code generation (output directory, parent module, …) live on
your capnpc code generator, not here — this type only runs the compiler.
Implementations§
Source§impl CompileCommand
impl CompileCommand
Sourcepub fn file<P: AsRef<Path>>(&mut self, path: P) -> &mut Self
pub fn file<P: AsRef<Path>>(&mut self, path: P) -> &mut Self
Adds a schema file to compile. Paths are resolved relative to the current working directory (typically the crate root during a build script).
Sourcepub fn src_prefix<P: AsRef<Path>>(&mut self, prefix: P) -> &mut Self
pub fn src_prefix<P: AsRef<Path>>(&mut self, prefix: P) -> &mut Self
Adds a --src-prefix: a prefix stripped from schema paths when the
compiler computes each file’s display name (which in turn drives the
generated file names).
Sourcepub fn import_path<P: AsRef<Path>>(&mut self, dir: P) -> &mut Self
pub fn import_path<P: AsRef<Path>>(&mut self, dir: P) -> &mut Self
Adds an --import-path directory searched for absolute (/foo.capnp)
imports.
Sourcepub fn no_standard_import(&mut self) -> &mut Self
pub fn no_standard_import(&mut self) -> &mut Self
Disables the embedded standard import schemas. Only set this if you are
providing your own copies of capnp/*.capnp via Self::import_path.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for CompileCommand
impl RefUnwindSafe for CompileCommand
impl Send for CompileCommand
impl Sync for CompileCommand
impl Unpin for CompileCommand
impl UnsafeUnpin for CompileCommand
impl UnwindSafe for CompileCommand
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> GetSetFdFlags for T
impl<T> GetSetFdFlags for T
Source§fn get_fd_flags(&self) -> Result<FdFlags, Error>where
T: AsFilelike,
fn get_fd_flags(&self) -> Result<FdFlags, Error>where
T: AsFilelike,
self file descriptor.Source§fn new_set_fd_flags(&self, fd_flags: FdFlags) -> Result<SetFdFlags<T>, Error>where
T: AsFilelike,
fn new_set_fd_flags(&self, fd_flags: FdFlags) -> Result<SetFdFlags<T>, Error>where
T: AsFilelike,
Source§fn set_fd_flags(&mut self, set_fd_flags: SetFdFlags<T>) -> Result<(), Error>where
T: Sized + AsFilelike,
fn set_fd_flags(&mut self, set_fd_flags: SetFdFlags<T>) -> Result<(), Error>where
T: Sized + AsFilelike,
self file descriptor. Read more