wasmer_wit_bindgen_gen_rust

Trait RustGenerator

Source
pub trait RustGenerator {
Show 38 methods // Required methods fn push_str(&mut self, s: &str); fn info(&self, ty: TypeId) -> TypeInfo; fn types_mut(&mut self) -> &mut Types; fn print_borrowed_slice( &mut self, iface: &Interface, mutbl: bool, ty: &Type, lifetime: &'static str, ); fn print_borrowed_str(&mut self, lifetime: &'static str); fn default_param_mode(&self) -> TypeMode; fn handle_projection(&self) -> Option<(&'static str, String)>; fn handle_wrapper(&self) -> Option<&'static str>; // Provided methods fn handle_in_super(&self) -> bool { ... } fn rustdoc(&mut self, docs: &Docs) { ... } fn rustdoc_params(&mut self, docs: &[(String, Type)], header: &str) { ... } fn print_signature( &mut self, iface: &Interface, func: &Function, param_mode: TypeMode, sig: &FnSig, ) -> Vec<String> { ... } fn print_docs_and_params( &mut self, iface: &Interface, func: &Function, param_mode: TypeMode, sig: &FnSig, ) -> Vec<String> { ... } fn print_ty(&mut self, iface: &Interface, ty: &Type, mode: TypeMode) { ... } fn print_tyid(&mut self, iface: &Interface, id: TypeId, mode: TypeMode) { ... } fn print_list(&mut self, iface: &Interface, ty: &Type, mode: TypeMode) { ... } fn print_rust_slice( &mut self, iface: &Interface, mutbl: bool, ty: &Type, lifetime: &'static str, ) { ... } fn print_generics( &mut self, info: &TypeInfo, lifetime: Option<&str>, bound: bool, ) { ... } fn int_repr(&mut self, repr: Int) { ... } fn wasm_type(&mut self, ty: WasmType) { ... } fn modes_of( &self, iface: &Interface, ty: TypeId, generate_struct_always: bool, ) -> Vec<(String, TypeMode)> { ... } fn write_name(&self, iface: &Interface, ty: &Type, out: &mut String) { ... } fn union_case_names(&self, iface: &Interface, union: &Union) -> Vec<String> { ... } fn print_typedef_record( &mut self, iface: &Interface, id: TypeId, record: &Record, docs: &Docs, generate_structs: bool, ) { ... } fn print_typedef_tuple( &mut self, iface: &Interface, id: TypeId, tuple: &Tuple, docs: &Docs, generate_structs: bool, ) { ... } fn print_typedef_variant( &mut self, iface: &Interface, id: TypeId, variant: &Variant, docs: &Docs, generate_structs: bool, ) where Self: Sized { ... } fn print_typedef_union( &mut self, iface: &Interface, id: TypeId, union: &Union, docs: &Docs, generate_structs: bool, ) where Self: Sized { ... } fn print_rust_enum<'a>( &mut self, iface: &Interface, id: TypeId, cases: impl IntoIterator<Item = (String, &'a Docs, &'a Type)> + Clone, docs: &Docs, generate_structs: bool, ) where Self: Sized { ... } fn print_rust_enum_debug<'a>( &mut self, id: TypeId, mode: TypeMode, name: &str, cases: impl IntoIterator<Item = (String, &'a Type)>, ) where Self: Sized { ... } fn print_typedef_option( &mut self, iface: &Interface, id: TypeId, payload: &Type, docs: &Docs, generate_structs: bool, ) { ... } fn print_typedef_expected( &mut self, iface: &Interface, id: TypeId, expected: &Expected, docs: &Docs, generate_structs: bool, ) { ... } fn print_typedef_enum( &mut self, id: TypeId, name: &str, enum_: &Enum, docs: &Docs, generate_structs: bool, ) where Self: Sized { ... } fn print_typedef_alias( &mut self, iface: &Interface, id: TypeId, ty: &Type, docs: &Docs, generate_structs: bool, ) { ... } fn print_type_list( &mut self, iface: &Interface, id: TypeId, ty: &Type, docs: &Docs, generate_structs: bool, ) { ... } fn param_name(&self, iface: &Interface, ty: TypeId) -> String { ... } fn result_name(&self, iface: &Interface, ty: TypeId) -> String { ... } fn uses_two_names(&self, info: &TypeInfo) -> bool { ... } fn lifetime_for( &self, info: &TypeInfo, mode: TypeMode, ) -> Option<&'static str> { ... }
}

Required Methods§

Source

fn push_str(&mut self, s: &str)

Source

fn info(&self, ty: TypeId) -> TypeInfo

Source

fn types_mut(&mut self) -> &mut Types

Source

fn print_borrowed_slice( &mut self, iface: &Interface, mutbl: bool, ty: &Type, lifetime: &'static str, )

Source

fn print_borrowed_str(&mut self, lifetime: &'static str)

Source

fn default_param_mode(&self) -> TypeMode

Source

fn handle_projection(&self) -> Option<(&'static str, String)>

Source

fn handle_wrapper(&self) -> Option<&'static str>

Provided Methods§

Source

fn handle_in_super(&self) -> bool

Source

fn rustdoc(&mut self, docs: &Docs)

Source

fn rustdoc_params(&mut self, docs: &[(String, Type)], header: &str)

Source

fn print_signature( &mut self, iface: &Interface, func: &Function, param_mode: TypeMode, sig: &FnSig, ) -> Vec<String>

Source

fn print_docs_and_params( &mut self, iface: &Interface, func: &Function, param_mode: TypeMode, sig: &FnSig, ) -> Vec<String>

Source

fn print_ty(&mut self, iface: &Interface, ty: &Type, mode: TypeMode)

Source

fn print_tyid(&mut self, iface: &Interface, id: TypeId, mode: TypeMode)

Source

fn print_list(&mut self, iface: &Interface, ty: &Type, mode: TypeMode)

Source

fn print_rust_slice( &mut self, iface: &Interface, mutbl: bool, ty: &Type, lifetime: &'static str, )

Source

fn print_generics( &mut self, info: &TypeInfo, lifetime: Option<&str>, bound: bool, )

Source

fn int_repr(&mut self, repr: Int)

Source

fn wasm_type(&mut self, ty: WasmType)

Source

fn modes_of( &self, iface: &Interface, ty: TypeId, generate_struct_always: bool, ) -> Vec<(String, TypeMode)>

Source

fn write_name(&self, iface: &Interface, ty: &Type, out: &mut String)

Writes the camel-cased ‘name’ of the passed type to out, as used to name union variants.

Source

fn union_case_names(&self, iface: &Interface, union: &Union) -> Vec<String>

Returns the names for the cases of the passed union.

Source

fn print_typedef_record( &mut self, iface: &Interface, id: TypeId, record: &Record, docs: &Docs, generate_structs: bool, )

Source

fn print_typedef_tuple( &mut self, iface: &Interface, id: TypeId, tuple: &Tuple, docs: &Docs, generate_structs: bool, )

Source

fn print_typedef_variant( &mut self, iface: &Interface, id: TypeId, variant: &Variant, docs: &Docs, generate_structs: bool, )
where Self: Sized,

Source

fn print_typedef_union( &mut self, iface: &Interface, id: TypeId, union: &Union, docs: &Docs, generate_structs: bool, )
where Self: Sized,

Source

fn print_rust_enum<'a>( &mut self, iface: &Interface, id: TypeId, cases: impl IntoIterator<Item = (String, &'a Docs, &'a Type)> + Clone, docs: &Docs, generate_structs: bool, )
where Self: Sized,

Source

fn print_rust_enum_debug<'a>( &mut self, id: TypeId, mode: TypeMode, name: &str, cases: impl IntoIterator<Item = (String, &'a Type)>, )
where Self: Sized,

Source

fn print_typedef_option( &mut self, iface: &Interface, id: TypeId, payload: &Type, docs: &Docs, generate_structs: bool, )

Source

fn print_typedef_expected( &mut self, iface: &Interface, id: TypeId, expected: &Expected, docs: &Docs, generate_structs: bool, )

Source

fn print_typedef_enum( &mut self, id: TypeId, name: &str, enum_: &Enum, docs: &Docs, generate_structs: bool, )
where Self: Sized,

Source

fn print_typedef_alias( &mut self, iface: &Interface, id: TypeId, ty: &Type, docs: &Docs, generate_structs: bool, )

Source

fn print_type_list( &mut self, iface: &Interface, id: TypeId, ty: &Type, docs: &Docs, generate_structs: bool, )

Source

fn param_name(&self, iface: &Interface, ty: TypeId) -> String

Source

fn result_name(&self, iface: &Interface, ty: TypeId) -> String

Source

fn uses_two_names(&self, info: &TypeInfo) -> bool

Source

fn lifetime_for(&self, info: &TypeInfo, mode: TypeMode) -> Option<&'static str>

Implementors§