pub trait RustGenerator {
Show 38 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>; 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

Provided Methods

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

Returns the names for the cases of the passed union.

Implementors