pub struct RustWasm { /* private fields */ }

Implementations§

Trait Implementations§

source§

impl Default for RustWasm

source§

fn default() -> RustWasm

Returns the “default value” for a type. Read more
source§

impl Generator for RustWasm

source§

fn preprocess_one(&mut self, iface: &Interface, dir: Direction)

source§

fn type_record( &mut self, iface: &Interface, id: TypeId, _name: &str, record: &Record, docs: &Docs )

source§

fn type_tuple( &mut self, iface: &Interface, id: TypeId, _name: &str, tuple: &Tuple, docs: &Docs )

source§

fn type_flags( &mut self, _iface: &Interface, _id: TypeId, name: &str, flags: &Flags, docs: &Docs )

source§

fn type_variant( &mut self, iface: &Interface, id: TypeId, _name: &str, variant: &Variant, docs: &Docs )

source§

fn type_union( &mut self, iface: &Interface, id: TypeId, _name: &str, union: &Union, docs: &Docs )

source§

fn type_option( &mut self, iface: &Interface, id: TypeId, _name: &str, payload: &Type, docs: &Docs )

source§

fn type_expected( &mut self, iface: &Interface, id: TypeId, _name: &str, expected: &Expected, docs: &Docs )

source§

fn type_enum( &mut self, _iface: &Interface, id: TypeId, name: &str, enum_: &Enum, docs: &Docs )

source§

fn type_resource(&mut self, iface: &Interface, ty: ResourceId)

source§

fn type_alias( &mut self, iface: &Interface, id: TypeId, _name: &str, ty: &Type, docs: &Docs )

source§

fn type_list( &mut self, iface: &Interface, id: TypeId, _name: &str, ty: &Type, docs: &Docs )

source§

fn type_builtin( &mut self, iface: &Interface, _id: TypeId, name: &str, ty: &Type, docs: &Docs )

source§

fn preprocess_functions(&mut self, _iface: &Interface, dir: Direction)

source§

fn import(&mut self, iface: &Interface, func: &Function)

source§

fn export(&mut self, iface: &Interface, func: &Function)

source§

fn finish_functions(&mut self, iface: &Interface, dir: Direction)

source§

fn finish_one(&mut self, iface: &Interface, files: &mut Files)

source§

fn preprocess_all(&mut self, imports: &[Interface], exports: &[Interface])

source§

fn finish_all(&mut self, files: &mut Files)

source§

fn generate_one(&mut self, iface: &Interface, dir: Direction, files: &mut Files)

source§

fn generate_all( &mut self, imports: &[Interface], exports: &[Interface], files: &mut Files )

source§

impl RustGenerator for RustWasm

source§

fn always_generate_structs(&self) -> bool

Make the code generator always generate types, even if they are never used.
source§

fn default_param_mode(&self) -> TypeMode

source§

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

source§

fn handle_in_super(&self) -> bool

source§

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

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 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, Global>

source§

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

source§

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

source§

fn print_tyid(&mut self, iface: &Interface, id: Id<TypeDef>, 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: Id<TypeDef> ) -> Vec<(String, TypeMode), Global>

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, Global>

Returns the names for the cases of the passed union.
source§

fn print_typedef_record( &mut self, iface: &Interface, id: Id<TypeDef>, record: &Record, docs: &Docs )

source§

fn print_typedef_tuple( &mut self, iface: &Interface, id: Id<TypeDef>, tuple: &Tuple, docs: &Docs )

source§

fn print_typedef_variant( &mut self, iface: &Interface, id: Id<TypeDef>, variant: &Variant, docs: &Docs )where Self: Sized,

source§

fn print_typedef_union( &mut self, iface: &Interface, id: Id<TypeDef>, union: &Union, docs: &Docs )where Self: Sized,

source§

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

source§

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

source§

fn print_typedef_option( &mut self, iface: &Interface, id: Id<TypeDef>, payload: &Type, docs: &Docs )

source§

fn print_typedef_expected( &mut self, iface: &Interface, id: Id<TypeDef>, expected: &Expected, docs: &Docs )

source§

fn print_typedef_enum( &mut self, id: Id<TypeDef>, name: &str, enum_: &Enum, docs: &Docs )where Self: Sized,

source§

fn print_typedef_alias( &mut self, iface: &Interface, id: Id<TypeDef>, ty: &Type, docs: &Docs )

source§

fn print_type_list( &mut self, iface: &Interface, id: Id<TypeDef>, ty: &Type, docs: &Docs )

source§

fn param_name(&self, iface: &Interface, ty: Id<TypeDef>) -> String

source§

fn result_name(&self, iface: &Interface, ty: Id<TypeDef>) -> String

source§

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

source§

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

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

const: unstable · source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

const: unstable · source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

const: unstable · source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

const: unstable · source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
const: unstable · source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
const: unstable · source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.