Struct wasm_bindgen_backend::ast::ImportFunction
source · pub struct ImportFunction {
pub function: Function,
pub rust_name: Ident,
pub js_ret: Option<Type>,
pub catch: bool,
pub variadic: bool,
pub structural: bool,
pub kind: ImportFunctionKind,
pub shim: Ident,
pub doc_comment: Option<String>,
}
Fields
function: Function
rust_name: Ident
js_ret: Option<Type>
catch: bool
variadic: bool
structural: bool
kind: ImportFunctionKind
shim: Ident
doc_comment: Option<String>
Implementations
sourceimpl ImportFunction
impl ImportFunction
sourcepub fn infer_getter_property(&self) -> &str
pub fn infer_getter_property(&self) -> &str
If the rust object has a fn xxx(&self) -> MyType
method, get the name for a getter in
javascript (in this case xxx
, so you can write val = obj.xxx
)
sourcepub fn infer_setter_property(&self) -> Result<String, Diagnostic>
pub fn infer_setter_property(&self) -> Result<String, Diagnostic>
If the rust object has a fn set_xxx(&mut self, MyType)
style method, get the name
for a setter in javascript (in this case xxx
, so you can write obj.xxx = val
)
Trait Implementations
sourceimpl Clone for ImportFunction
impl Clone for ImportFunction
sourcefn clone(&self) -> ImportFunction
fn clone(&self) -> ImportFunction
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresourceimpl ImportedTypes for ImportFunction
impl ImportedTypes for ImportFunction
fn imported_types<F>(&self, f: &mut F)where
F: FnMut(&Ident, ImportedTypeKind),
sourceimpl TryToTokens for ImportFunction
impl TryToTokens for ImportFunction
fn try_to_tokens(&self, tokens: &mut TokenStream) -> Result<(), Diagnostic>
fn try_to_token_stream(&self) -> Result<TokenStream, Diagnostic>
Auto Trait Implementations
impl RefUnwindSafe for ImportFunction
impl !Send for ImportFunction
impl !Sync for ImportFunction
impl Unpin for ImportFunction
impl UnwindSafe for ImportFunction
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more