pub struct RustWasm { /* private fields */ }Implementations§
Source§impl RustWasm
impl RustWasm
Sourcepub fn generate_to_out_dir(self, world: Option<&str>) -> Result<PathBuf>
pub fn generate_to_out_dir(self, world: Option<&str>) -> Result<PathBuf>
Generates Rust bindings from the wit/ directory and writes
the result into Cargo’s OUT_DIR. Intended for use in build.rs.
The world parameter specifies the world name to select.
It must be provided unless the main package contains exactly one world.
Returns the full path to the generated bindings file.
Trait Implementations§
Source§impl WorldGenerator for RustWasm
impl WorldGenerator for RustWasm
fn preprocess(&mut self, resolve: &Resolve, world: WorldId)
fn import_interface( &mut self, resolve: &Resolve, name: &WorldKey, id: InterfaceId, _files: &mut Files, ) -> Result<()>
fn import_funcs( &mut self, resolve: &Resolve, world: WorldId, funcs: &[(&str, &Function)], _files: &mut Files, )
fn export_interface( &mut self, resolve: &Resolve, name: &WorldKey, id: InterfaceId, _files: &mut Files, ) -> Result<()>
fn export_funcs( &mut self, resolve: &Resolve, world: WorldId, funcs: &[(&str, &Function)], _files: &mut Files, ) -> Result<()>
fn import_types( &mut self, resolve: &Resolve, world: WorldId, types: &[(&str, TypeId)], _files: &mut Files, )
fn finish_imports( &mut self, resolve: &Resolve, world: WorldId, files: &mut Files, )
fn finish( &mut self, resolve: &Resolve, world: WorldId, files: &mut Files, ) -> Result<()>
fn generate( &mut self, resolve: &Resolve, id: Id<World>, files: &mut Files, ) -> Result<(), Error>
Auto Trait Implementations§
impl Freeze for RustWasm
impl RefUnwindSafe for RustWasm
impl Send for RustWasm
impl Sync for RustWasm
impl Unpin for RustWasm
impl UnwindSafe for RustWasm
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