Struct capnpc::codegen::CodeGenerationCommand
source · pub struct CodeGenerationCommand { /* private fields */ }
Expand description
An invocation of the capnpc-rust code generation plugin.
Implementations§
source§impl CodeGenerationCommand
impl CodeGenerationCommand
sourcepub fn output_directory<P>(&mut self, path: P) -> &mut Self
pub fn output_directory<P>(&mut self, path: P) -> &mut Self
Sets the output directory.
sourcepub fn default_parent_module(
&mut self,
default_parent_module: Vec<String>,
) -> &mut Self
pub fn default_parent_module( &mut self, default_parent_module: Vec<String>, ) -> &mut Self
Sets the default parent module, indicating the scope in your crate where you will add the generated code.
This option can be overridden by the parentModule
annotation defined in rust.capnp
.
sourcepub fn capnp_root(&mut self, capnp_root: &str) -> &mut Self
pub fn capnp_root(&mut self, capnp_root: &str) -> &mut Self
Sets the root path for referencing things in the capnp
crate from the generated
code. Usually this is ::capnp
. When we bootstrap schema.capnp we set this to crate
.
If you are renaming the capnp
crate when importing it, then you probably want to set
this value.
sourcepub fn raw_code_generator_request_path<P>(&mut self, path: P) -> &mut Self
pub fn raw_code_generator_request_path<P>(&mut self, path: P) -> &mut Self
Sets the raw code generator request output path.
sourcepub fn crates_provide_map(&mut self, map: HashMap<u64, String>) -> &mut Self
pub fn crates_provide_map(&mut self, map: HashMap<u64, String>) -> &mut Self
Sets the crate provides map.
§Arguments
map
- A map from capnp file id to the crate name that provides the corresponding generated code.
See crate::CompilerCommand::crate_provides
for more details.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for CodeGenerationCommand
impl RefUnwindSafe for CodeGenerationCommand
impl Send for CodeGenerationCommand
impl Sync for CodeGenerationCommand
impl Unpin for CodeGenerationCommand
impl UnwindSafe for CodeGenerationCommand
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
Mutably borrows from an owned value. Read more