pub struct BuildSystem { /* private fields */ }Expand description
Build-time code generation orchestrator.
Integrates TypeScript binding generation into Rust build scripts. This allows automatic regeneration of bindings whenever the Rust code changes.
Implementations§
Source§impl BuildSystem
impl BuildSystem
Sourcepub fn new(verbose: bool, debug: bool) -> Self
pub fn new(verbose: bool, debug: bool) -> Self
Create a new build system instance.
§Arguments
verbose- Enable verbose outputdebug- Enable debug logging
Sourcepub fn generate_at_build_time() -> Result<(), Box<dyn Error>>
pub fn generate_at_build_time() -> Result<(), Box<dyn Error>>
Generate TypeScript bindings at build time.
This is the recommended way to integrate tauri-typegen into your build process.
Call this from your src-tauri/build.rs file to automatically generate bindings
whenever you run cargo build or cargo tauri dev.
§Returns
Returns Ok(()) on success, or an error if generation fails.
§Example
In src-tauri/build.rs:
ⓘ
fn main() {
// Generate TypeScript bindings before build
tauri_typegen::BuildSystem::generate_at_build_time()
.expect("Failed to generate TypeScript bindings");
tauri_build::build()
}§Configuration
Reads configuration from tauri.conf.json in the project root.
If no configuration is found, uses default settings with vanilla TypeScript output.
Auto Trait Implementations§
impl Freeze for BuildSystem
impl RefUnwindSafe for BuildSystem
impl Send for BuildSystem
impl Sync for BuildSystem
impl Unpin for BuildSystem
impl UnwindSafe for BuildSystem
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