pub struct CodegenBuilder { /* private fields */ }Expand description
Builder for generating a decoder with type mappings and dispatch strategy control.
Use this when you need to map chipi type names to Rust wrapper types (replacing
the removed import/as syntax) or control the dispatch strategy per decoder.
§Example (build.rs)
ⓘ
chipi::CodegenBuilder::new("src/gcdsp.chipi")
.type_map("reg5", "crate::dsp::DspReg")
.decoder_dispatch("GcDsp", chipi::Dispatch::FnPtrLut)
.decoder_dispatch("GcDspExt", chipi::Dispatch::JumpTable)
.output("src/generated/gcdsp.rs")
.run();Implementations§
Source§impl CodegenBuilder
impl CodegenBuilder
Sourcepub fn new(input: impl Into<String>) -> Self
pub fn new(input: impl Into<String>) -> Self
Create a new builder targeting the given .chipi spec file.
Sourcepub fn decoder_dispatch(self, decoder_name: &str, strategy: Dispatch) -> Self
pub fn decoder_dispatch(self, decoder_name: &str, strategy: Dispatch) -> Self
Set the dispatch strategy for a specific decoder or sub-decoder.
Defaults: JumpTable for sub-decoders, decision tree for main decoders.
Trait Implementations§
Source§impl Default for CodegenBuilder
impl Default for CodegenBuilder
Source§fn default() -> CodegenBuilder
fn default() -> CodegenBuilder
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for CodegenBuilder
impl RefUnwindSafe for CodegenBuilder
impl Send for CodegenBuilder
impl Sync for CodegenBuilder
impl Unpin for CodegenBuilder
impl UnsafeUnpin for CodegenBuilder
impl UnwindSafe for CodegenBuilder
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