mirror of
https://github.com/rustwasm/wasm-bindgen.git
synced 2024-11-30 12:33:54 +03:00
Added support for the wasm32v1-none
target (#4277)
This PR adds support for the `wasm32v1-none` target and should enable all features previously behind `cfg(feature = "std")` for both `wasm32-unknown-unknown` and `wasm32v1-none`. Additionally, now `js-sys`, `web-sys`, `wasm-bindgen-futures` and `wasm-bindgen-test` support `no_std`. Changes: - Use `any(target_os = "unknown", target_os = "none")` instead of `target_os = "unknown"`. - For globals: - Continue to use `once_cell::sync::Lazy` when targeting `std`. - Use `Send + Sync` wrapped `once_cell::unsync::Lazy` when targeting `no_std` without `target_feature = "atomics"`. - Use `once_cell/critical_section` when targeting `no_std` with `target_feature = "atomics"`. As recommended by `critical_section`, this is something the user has to enable. Notable this only affects `link_to!`, any other feature will work as expected with no additional work required from the user. - For thread locals: - Continue to use `std::thread_local!` when targeting `std`. - Use `static mut` when targeting `no_std` without `target_feature = "atomics"`. - Use `#[thread_local]` when targeting `no_std` with `target_feature = "atomics"`. - Add `std` crate feature to `js-sys`, `web-sys`, `wasm-bindgen-futures` and `wasm-bindgen-test` and enable by default. This makes it possible to use these crates with `no_std` for both targets as well. - Inlined [`console_error_panic_hook`](https://crates.io/crates/console_error_panic_hook) and a `no_std` version of [`scoped_tls`](https://crates.io/crates/scoped-tls). Missing: - Add `wasm32v1-none` to CI. Probably in a follow-up when its stable, ergo Rust v1.84.
This commit is contained in:
parent
fe5d89fcf5
commit
f071c7eb4c
@ -1,4 +1,4 @@
|
||||
[target.wasm32-unknown-unknown]
|
||||
[target.'cfg(target_arch = "wasm32")']
|
||||
runner = 'cargo run -p wasm-bindgen-cli --bin wasm-bindgen-test-runner --'
|
||||
|
||||
[target.'cfg(all())']
|
||||
|
32
.github/workflows/main.yml
vendored
32
.github/workflows/main.yml
vendored
@ -92,6 +92,37 @@ jobs:
|
||||
- run: cargo clippy --no-deps --all-features --target wasm32-unknown-unknown -p js-sys -- -D warnings
|
||||
- run: cargo clippy --no-deps --all-features --target wasm32-unknown-unknown -p web-sys -- -D warnings
|
||||
|
||||
# Run `cargo clippy` over crates that support `no_std`
|
||||
clippy_no_std:
|
||||
name: Clippy `no_std`
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- run: rustup update --no-self-update stable && rustup default stable
|
||||
- run: rustup target add wasm32-unknown-unknown
|
||||
- run: cargo clippy --no-deps --no-default-features --target wasm32-unknown-unknown -p wasm-bindgen -- -D warnings
|
||||
- run: cargo clippy --no-deps --no-default-features --target wasm32-unknown-unknown -p js-sys -- -D warnings
|
||||
- run: cargo clippy --no-deps --no-default-features --target wasm32-unknown-unknown -p web-sys -- -D warnings
|
||||
- run: cargo clippy --no-deps --no-default-features --target wasm32-unknown-unknown -p wasm-bindgen-futures -- -D warnings
|
||||
- run: cargo clippy --no-deps --no-default-features --target wasm32-unknown-unknown -p wasm-bindgen-test -- -D warnings
|
||||
|
||||
# Run `cargo clippy` over crates that support `no_std` with `target_feature = "atomics"` support.
|
||||
clippy_no_std_atomics:
|
||||
name: Clippy `no_std` with `atomics`
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
CARGO_TARGET_WASM32_UNKNOWN_UNKNOWN_RUSTFLAGS: -Ctarget-feature=+atomics,+bulk-memory
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- run: rustup default nightly-2024-07-06
|
||||
- run: rustup target add wasm32-unknown-unknown
|
||||
- run: rustup component add clippy rust-src
|
||||
- run: cargo clippy --no-deps --no-default-features --target wasm32-unknown-unknown -p wasm-bindgen -Zbuild-std=core,alloc -- -D warnings
|
||||
- run: cargo clippy --no-deps --no-default-features --target wasm32-unknown-unknown -p js-sys -Zbuild-std=core,alloc -- -D warnings
|
||||
- run: cargo clippy --no-deps --no-default-features --target wasm32-unknown-unknown -p web-sys -Zbuild-std=core,alloc -- -D warnings
|
||||
- run: cargo clippy --no-deps --no-default-features --target wasm32-unknown-unknown -p wasm-bindgen-futures --features once_cell/critical-section -Zbuild-std=core,alloc -- -D warnings
|
||||
- run: cargo clippy --no-deps --no-default-features --target wasm32-unknown-unknown -p wasm-bindgen-test --features once_cell/critical-section -Zbuild-std=core,alloc -- -D warnings
|
||||
|
||||
# Run `cargo clippy` over the project
|
||||
clippy_project:
|
||||
name: Clippy (project)
|
||||
@ -100,7 +131,6 @@ jobs:
|
||||
- uses: actions/checkout@v4
|
||||
- run: rustup update --no-self-update stable && rustup default stable
|
||||
- run: rustup target add wasm32-unknown-unknown
|
||||
- run: cargo clippy --no-deps --no-default-features --target wasm32-unknown-unknown -- -D warnings
|
||||
- run: cargo clippy --no-deps --all-features --target wasm32-unknown-unknown -- -D warnings
|
||||
- run: cargo clippy --no-deps --all-features --target wasm32-unknown-unknown --tests -- -D warnings
|
||||
- run: for i in examples/*/; do cd "$i"; cargo +stable clippy --no-deps --all-features --target wasm32-unknown-unknown -- -D warnings || exit 1; cd ../..; done
|
||||
|
12
CHANGELOG.md
12
CHANGELOG.md
@ -23,6 +23,15 @@
|
||||
* Added WASM ABI support for `u128` and `i128`
|
||||
[#4222](https://github.com/rustwasm/wasm-bindgen/pull/4222)
|
||||
|
||||
* Added support for the `wasm32v1-none` target.
|
||||
[#4277](https://github.com/rustwasm/wasm-bindgen/pull/4277)
|
||||
|
||||
* Added support for `no_std` to `js-sys`, `web-sys`, `wasm-bindgen-futures` and `wasm-bindgen-test`.
|
||||
[#4277](https://github.com/rustwasm/wasm-bindgen/pull/4277)
|
||||
|
||||
* Added support for `no_std` to `link_to!`, `static_string` (via `thread_local_v2`) and `throw`.
|
||||
[#4277](https://github.com/rustwasm/wasm-bindgen/pull/4277)
|
||||
|
||||
### Changed
|
||||
|
||||
* String enums now generate private TypeScript types but only if used.
|
||||
@ -46,6 +55,9 @@
|
||||
* `wasm-bindgen-test-runner` now tries to restart the WebDriver on failure, instead of spending its timeout period trying to connect to a non-existing WebDriver.
|
||||
[#4267](https://github.com/rustwasm/wasm-bindgen/pull/4267)
|
||||
|
||||
* Deprecated `#[wasm_bindgen(thread_local)]` in favor of `#[wasm_bindgen(thread_local_v2)]`, which creates a `wasm_bindgen::JsThreadLocal`. It is similar to `std::thread::LocalKey` but supports `no_std`.
|
||||
[#4277](https://github.com/rustwasm/wasm-bindgen/pull/4277)
|
||||
|
||||
### Fixed
|
||||
|
||||
* Fixed methods with `self: &Self` consuming the object.
|
||||
|
11
Cargo.toml
11
Cargo.toml
@ -26,7 +26,7 @@ default = ["spans", "std"]
|
||||
enable-interning = ["std"]
|
||||
serde-serialize = ["serde", "serde_json", "std"]
|
||||
spans = ["wasm-bindgen-macro/spans"]
|
||||
std = []
|
||||
std = ["wasm-bindgen-macro/std", "once_cell/std"]
|
||||
|
||||
# Whether or not the `#[wasm_bindgen]` macro is strict and generates an error on
|
||||
# all unused attributes
|
||||
@ -42,10 +42,15 @@ xxx_debug_only_print_generated_code = ["wasm-bindgen-macro/xxx_debug_only_print_
|
||||
|
||||
[dependencies]
|
||||
cfg-if = "1.0.0"
|
||||
once_cell = "1.12"
|
||||
once_cell = { version = "1.12", default-features = false }
|
||||
serde = { version = "1.0", optional = true }
|
||||
serde_json = { version = "1.0", optional = true }
|
||||
wasm-bindgen-macro = { path = "crates/macro", version = "=0.2.95" }
|
||||
wasm-bindgen-macro = { path = "crates/macro", version = "=0.2.95", default-features = false }
|
||||
|
||||
[target.'cfg(all(target_arch = "wasm32", any(target_os = "unknown", target_os = "none"), target_feature = "atomics"))'.dependencies]
|
||||
wasm-bindgen-macro = { path = "crates/macro", version = "=0.2.95", default-features = false, features = [
|
||||
"atomics",
|
||||
] }
|
||||
|
||||
[dev-dependencies]
|
||||
wasm-bindgen-test = { path = 'crates/test' }
|
||||
|
@ -14,8 +14,11 @@ rust-version = "1.57"
|
||||
version = "0.2.95"
|
||||
|
||||
[features]
|
||||
atomics = []
|
||||
default = ["std"]
|
||||
extra-traits = ["syn/extra-traits"]
|
||||
spans = []
|
||||
std = []
|
||||
|
||||
[dependencies]
|
||||
bumpalo = "3.0.0"
|
||||
|
@ -275,8 +275,17 @@ pub struct ImportStatic {
|
||||
pub js_name: String,
|
||||
/// Path to wasm_bindgen
|
||||
pub wasm_bindgen: Path,
|
||||
/// [`true`] if using the new `thread_local` representation.
|
||||
pub thread_local: bool,
|
||||
/// Version of `thread_local`, if any.
|
||||
pub thread_local: Option<ThreadLocal>,
|
||||
}
|
||||
|
||||
/// Which version of the `thread_local` attribute is enabled.
|
||||
#[derive(Copy, Clone, Debug, PartialEq, Eq)]
|
||||
pub enum ThreadLocal {
|
||||
/// V1.
|
||||
V1,
|
||||
/// V2.
|
||||
V2,
|
||||
}
|
||||
|
||||
/// The type of a static string being imported
|
||||
@ -297,6 +306,8 @@ pub struct ImportString {
|
||||
pub js_sys: Path,
|
||||
/// The string to export.
|
||||
pub string: String,
|
||||
/// Version of `thread_local`.
|
||||
pub thread_local: ThreadLocal,
|
||||
}
|
||||
|
||||
/// The metadata for a type being imported
|
||||
|
@ -163,7 +163,7 @@ impl TryToTokens for ast::Program {
|
||||
let prefix_json_bytes = syn::LitByteStr::new(&prefix_json_bytes, Span::call_site());
|
||||
|
||||
(quote! {
|
||||
#[cfg(all(target_arch = "wasm32", target_os = "unknown"))]
|
||||
#[cfg(all(target_arch = "wasm32", any(target_os = "unknown", target_os = "none")))]
|
||||
#[automatically_derived]
|
||||
const _: () = {
|
||||
use #wasm_bindgen::__rt::{flat_len, flat_byte_slices};
|
||||
@ -201,9 +201,10 @@ impl TryToTokens for ast::LinkToModule {
|
||||
#program
|
||||
#extern_fn
|
||||
|
||||
static __VAL: #wasm_bindgen::__rt::Lazy<String> = #wasm_bindgen::__rt::Lazy::new(|| unsafe {
|
||||
<#wasm_bindgen::__rt::alloc::string::String as #wasm_bindgen::convert::FromWasmAbi>::from_abi(#name().join())
|
||||
});
|
||||
static __VAL: #wasm_bindgen::__rt::once_cell::sync::Lazy<#wasm_bindgen::__rt::alloc::string::String> =
|
||||
#wasm_bindgen::__rt::once_cell::sync::Lazy::new(|| unsafe {
|
||||
<#wasm_bindgen::__rt::alloc::string::String as #wasm_bindgen::convert::FromWasmAbi>::from_abi(#name().join())
|
||||
});
|
||||
|
||||
#wasm_bindgen::__rt::alloc::string::String::clone(&__VAL)
|
||||
}
|
||||
@ -275,12 +276,12 @@ impl ToTokens for ast::Struct {
|
||||
let ptr = #wasm_bindgen::convert::IntoWasmAbi::into_abi(value);
|
||||
|
||||
#[link(wasm_import_module = "__wbindgen_placeholder__")]
|
||||
#[cfg(all(target_arch = "wasm32", target_os = "unknown"))]
|
||||
#[cfg(all(target_arch = "wasm32", any(target_os = "unknown", target_os = "none")))]
|
||||
extern "C" {
|
||||
fn #new_fn(ptr: u32) -> u32;
|
||||
}
|
||||
|
||||
#[cfg(not(all(target_arch = "wasm32", target_os = "unknown")))]
|
||||
#[cfg(not(all(target_arch = "wasm32", any(target_os = "unknown", target_os = "none"))))]
|
||||
unsafe fn #new_fn(_: u32) -> u32 {
|
||||
panic!("cannot convert to JsValue outside of the Wasm target")
|
||||
}
|
||||
@ -292,7 +293,7 @@ impl ToTokens for ast::Struct {
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(all(target_arch = "wasm32", target_os = "unknown"))]
|
||||
#[cfg(all(target_arch = "wasm32", any(target_os = "unknown", target_os = "none")))]
|
||||
#[automatically_derived]
|
||||
const _: () = {
|
||||
#[no_mangle]
|
||||
@ -381,12 +382,12 @@ impl ToTokens for ast::Struct {
|
||||
let idx = #wasm_bindgen::convert::IntoWasmAbi::into_abi(&value);
|
||||
|
||||
#[link(wasm_import_module = "__wbindgen_placeholder__")]
|
||||
#[cfg(all(target_arch = "wasm32", target_os = "unknown"))]
|
||||
#[cfg(all(target_arch = "wasm32", any(target_os = "unknown", target_os = "none")))]
|
||||
extern "C" {
|
||||
fn #unwrap_fn(ptr: u32) -> u32;
|
||||
}
|
||||
|
||||
#[cfg(not(all(target_arch = "wasm32", target_os = "unknown")))]
|
||||
#[cfg(not(all(target_arch = "wasm32", any(target_os = "unknown", target_os = "none"))))]
|
||||
unsafe fn #unwrap_fn(_: u32) -> u32 {
|
||||
panic!("cannot convert from JsValue outside of the Wasm target")
|
||||
}
|
||||
@ -493,7 +494,7 @@ impl ToTokens for ast::StructField {
|
||||
(quote! {
|
||||
#[automatically_derived]
|
||||
const _: () = {
|
||||
#[cfg_attr(all(target_arch = "wasm32", target_os = "unknown"), no_mangle)]
|
||||
#[cfg_attr(all(target_arch = "wasm32", any(target_os = "unknown", target_os = "none")), no_mangle)]
|
||||
#[doc(hidden)]
|
||||
#[cfg_attr(wasm_bindgen_unstable_test_coverage, coverage(off))]
|
||||
pub unsafe extern "C" fn #getter(js: u32)
|
||||
@ -532,7 +533,7 @@ impl ToTokens for ast::StructField {
|
||||
let (args, names) = splat(wasm_bindgen, &Ident::new("val", rust_name.span()), &abi);
|
||||
|
||||
(quote! {
|
||||
#[cfg(all(target_arch = "wasm32", target_os = "unknown"))]
|
||||
#[cfg(all(target_arch = "wasm32", any(target_os = "unknown", target_os = "none")))]
|
||||
#[automatically_derived]
|
||||
const _: () = {
|
||||
#[no_mangle]
|
||||
@ -791,7 +792,7 @@ impl TryToTokens for ast::Export {
|
||||
const _: () = {
|
||||
#(#attrs)*
|
||||
#[cfg_attr(
|
||||
all(target_arch = "wasm32", target_os = "unknown"),
|
||||
all(target_arch = "wasm32", any(target_os = "unknown", target_os = "none")),
|
||||
export_name = #export_name,
|
||||
)]
|
||||
#[cfg_attr(wasm_bindgen_unstable_test_coverage, coverage(off))]
|
||||
@ -1066,11 +1067,11 @@ impl ToTokens for ast::ImportType {
|
||||
impl JsCast for #rust_name {
|
||||
fn instanceof(val: &JsValue) -> bool {
|
||||
#[link(wasm_import_module = "__wbindgen_placeholder__")]
|
||||
#[cfg(all(target_arch = "wasm32", target_os = "unknown"))]
|
||||
#[cfg(all(target_arch = "wasm32", any(target_os = "unknown", target_os = "none")))]
|
||||
extern "C" {
|
||||
fn #instanceof_shim(val: u32) -> u32;
|
||||
}
|
||||
#[cfg(not(all(target_arch = "wasm32", target_os = "unknown")))]
|
||||
#[cfg(not(all(target_arch = "wasm32", any(target_os = "unknown", target_os = "none"))))]
|
||||
unsafe fn #instanceof_shim(_: u32) -> u32 {
|
||||
panic!("cannot check instanceof on non-wasm targets");
|
||||
}
|
||||
@ -1675,7 +1676,7 @@ impl ToTokens for ast::ImportStatic {
|
||||
fn to_tokens(&self, into: &mut TokenStream) {
|
||||
let ty = &self.ty;
|
||||
|
||||
if self.thread_local {
|
||||
if let Some(thread_local) = self.thread_local {
|
||||
thread_local_import(
|
||||
&self.vis,
|
||||
&self.rust_name,
|
||||
@ -1683,6 +1684,7 @@ impl ToTokens for ast::ImportStatic {
|
||||
ty,
|
||||
ty,
|
||||
&self.shim,
|
||||
thread_local,
|
||||
)
|
||||
.to_tokens(into)
|
||||
} else {
|
||||
@ -1695,7 +1697,7 @@ impl ToTokens for ast::ImportStatic {
|
||||
|
||||
into.extend(quote! {
|
||||
#[automatically_derived]
|
||||
#[deprecated = "use with `#[wasm_bindgen(thread_local)]` instead"]
|
||||
#[deprecated = "use with `#[wasm_bindgen(thread_local_v2)]` instead"]
|
||||
});
|
||||
into.extend(
|
||||
quote_spanned! { name.span() => #vis static #name: #wasm_bindgen::JsStatic<#ty> = {
|
||||
@ -1735,6 +1737,7 @@ impl ToTokens for ast::ImportString {
|
||||
&actual_ty,
|
||||
&self.ty,
|
||||
&self.shim,
|
||||
self.thread_local,
|
||||
)
|
||||
.to_tokens(into);
|
||||
}
|
||||
@ -1747,15 +1750,52 @@ fn thread_local_import(
|
||||
actual_ty: &syn::Type,
|
||||
ty: &syn::Type,
|
||||
shim_name: &Ident,
|
||||
thread_local: ast::ThreadLocal,
|
||||
) -> TokenStream {
|
||||
let init = static_init(wasm_bindgen, ty, shim_name);
|
||||
|
||||
quote! {
|
||||
thread_local! {
|
||||
#[automatically_derived]
|
||||
#vis static #name: #actual_ty = {
|
||||
#init
|
||||
match thread_local {
|
||||
ast::ThreadLocal::V1 => quote! {
|
||||
thread_local! {
|
||||
#[automatically_derived]
|
||||
#[deprecated = "use with `#[wasm_bindgen(thread_local_v2)]` instead"]
|
||||
#vis static #name: #actual_ty = {
|
||||
#init
|
||||
};
|
||||
}
|
||||
},
|
||||
ast::ThreadLocal::V2 => {
|
||||
#[cfg(feature = "std")]
|
||||
let inner = quote! {
|
||||
thread_local!(static _VAL: #actual_ty = init(););
|
||||
#wasm_bindgen::JsThreadLocal {
|
||||
__inner: &_VAL,
|
||||
}
|
||||
};
|
||||
#[cfg(all(not(feature = "std"), not(feature = "atomics")))]
|
||||
let inner = quote! {
|
||||
static _VAL: #wasm_bindgen::__rt::LazyCell<#actual_ty> = #wasm_bindgen::__rt::LazyCell::new(init);
|
||||
#wasm_bindgen::JsThreadLocal {
|
||||
__inner: &_VAL,
|
||||
}
|
||||
};
|
||||
#[cfg(all(not(feature = "std"), feature = "atomics"))]
|
||||
let inner = quote! {
|
||||
#[thread_local]
|
||||
static _VAL: #wasm_bindgen::__rt::LazyCell<#actual_ty> = #wasm_bindgen::__rt::LazyCell::new(init);
|
||||
#wasm_bindgen::JsThreadLocal {
|
||||
__inner: || unsafe { #wasm_bindgen::__rt::LazyCell::force(&_VAL) as *const #actual_ty },
|
||||
}
|
||||
};
|
||||
|
||||
quote! {
|
||||
#vis static #name: #wasm_bindgen::JsThreadLocal<#actual_ty> = {
|
||||
fn init() -> #actual_ty {
|
||||
#init
|
||||
}
|
||||
#inner
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1766,12 +1806,12 @@ fn static_init(wasm_bindgen: &syn::Path, ty: &syn::Type, shim_name: &Ident) -> T
|
||||
};
|
||||
quote! {
|
||||
#[link(wasm_import_module = "__wbindgen_placeholder__")]
|
||||
#[cfg(all(target_arch = "wasm32", target_os = "unknown"))]
|
||||
#[cfg(all(target_arch = "wasm32", any(target_os = "unknown", target_os = "none")))]
|
||||
extern "C" {
|
||||
fn #shim_name() -> #abi_ret;
|
||||
}
|
||||
|
||||
#[cfg(not(all(target_arch = "wasm32", target_os = "unknown")))]
|
||||
#[cfg(not(all(target_arch = "wasm32", any(target_os = "unknown", target_os = "none"))))]
|
||||
unsafe fn #shim_name() -> #abi_ret {
|
||||
panic!("cannot access imported statics on non-wasm targets")
|
||||
}
|
||||
@ -1818,7 +1858,7 @@ impl<'a, T: ToTokens> ToTokens for Descriptor<'a, T> {
|
||||
let attrs = &self.attrs;
|
||||
let wasm_bindgen = &self.wasm_bindgen;
|
||||
(quote! {
|
||||
#[cfg(all(target_arch = "wasm32", target_os = "unknown"))]
|
||||
#[cfg(all(target_arch = "wasm32", any(target_os = "unknown", target_os = "none")))]
|
||||
#[automatically_derived]
|
||||
const _: () = {
|
||||
#(#attrs)*
|
||||
@ -1845,14 +1885,14 @@ fn extern_fn(
|
||||
abi_ret: TokenStream,
|
||||
) -> TokenStream {
|
||||
quote! {
|
||||
#[cfg(all(target_arch = "wasm32", target_os = "unknown"))]
|
||||
#[cfg(all(target_arch = "wasm32", any(target_os = "unknown", target_os = "none")))]
|
||||
#(#attrs)*
|
||||
#[link(wasm_import_module = "__wbindgen_placeholder__")]
|
||||
extern "C" {
|
||||
fn #import_name(#(#abi_arguments),*) -> #abi_ret;
|
||||
}
|
||||
|
||||
#[cfg(not(all(target_arch = "wasm32", target_os = "unknown")))]
|
||||
#[cfg(not(all(target_arch = "wasm32", any(target_os = "unknown", target_os = "none"))))]
|
||||
unsafe fn #import_name(#(#abi_arguments),*) -> #abi_ret {
|
||||
#(
|
||||
drop(#abi_argument_names);
|
||||
|
@ -4,9 +4,9 @@
|
||||
(type (;2;) (func (result i32 i32)))
|
||||
(type (;3;) (func (param i32)))
|
||||
(import "./reference_test_bg.js" "__wbindgen_init_externref_table" (func (;0;) (type 0)))
|
||||
(func $__externref_table_dealloc (;1;) (type 3) (param i32))
|
||||
(func $__externref_table_alloc (;2;) (type 1) (result i32))
|
||||
(func $__wbindgen_exn_store (;3;) (type 3) (param i32))
|
||||
(func $__wbindgen_exn_store (;1;) (type 3) (param i32))
|
||||
(func $__externref_table_dealloc (;2;) (type 3) (param i32))
|
||||
(func $__externref_table_alloc (;3;) (type 1) (result i32))
|
||||
(func $"exported multivalue shim" (;4;) (type 2) (result i32 i32))
|
||||
(table (;0;) 128 externref)
|
||||
(memory (;0;) 17)
|
||||
|
@ -5,9 +5,9 @@
|
||||
(type (;3;) (func (param i32 i32 i32 i32) (result i32)))
|
||||
(func $__wbindgen_realloc (;0;) (type 3) (param i32 i32 i32 i32) (result i32))
|
||||
(func $__wbindgen_malloc (;1;) (type 2) (param i32 i32) (result i32))
|
||||
(func $get_url (;2;) (type 0) (result i32))
|
||||
(func $get_media_source (;3;) (type 0) (result i32))
|
||||
(func $__wbindgen_exn_store (;4;) (type 1) (param i32))
|
||||
(func $__wbindgen_exn_store (;2;) (type 1) (param i32))
|
||||
(func $get_url (;3;) (type 0) (result i32))
|
||||
(func $get_media_source (;4;) (type 0) (result i32))
|
||||
(memory (;0;) 17)
|
||||
(export "memory" (memory 0))
|
||||
(export "get_url" (func $get_url))
|
||||
|
@ -19,13 +19,17 @@ rustdoc-args = ["--cfg", "docsrs"]
|
||||
[dependencies]
|
||||
cfg-if = "1.0.0"
|
||||
futures-core = { version = '0.3.8', default-features = false, optional = true }
|
||||
js-sys = { path = "../js-sys", version = '0.3.72' }
|
||||
wasm-bindgen = { path = "../..", version = '0.2.95' }
|
||||
js-sys = { path = "../js-sys", version = '0.3.72', default-features = false }
|
||||
once_cell = { version = "1.12", default-features = false }
|
||||
wasm-bindgen = { path = "../..", version = '0.2.95', default-features = false }
|
||||
|
||||
[features]
|
||||
default = ["std"]
|
||||
futures-core-03-stream = ['futures-core']
|
||||
std = ["wasm-bindgen/std", "js-sys/std", "web-sys/std", "once_cell/std"]
|
||||
|
||||
[target.'cfg(target_feature = "atomics")'.dependencies.web-sys]
|
||||
default-features = false
|
||||
features = ["MessageEvent", "Worker"]
|
||||
path = "../web-sys"
|
||||
version = "0.3.24"
|
||||
|
@ -30,17 +30,25 @@
|
||||
//! systems and make sure that Rust/JavaScript can work together with
|
||||
//! asynchronous and I/O work.
|
||||
|
||||
#![cfg_attr(not(feature = "std"), no_std)]
|
||||
#![cfg_attr(target_feature = "atomics", feature(stdarch_wasm_atomic_wait))]
|
||||
#![cfg_attr(
|
||||
all(not(feature = "std"), target_feature = "atomics"),
|
||||
feature(thread_local)
|
||||
)]
|
||||
#![deny(missing_docs)]
|
||||
#![cfg_attr(docsrs, feature(doc_cfg))]
|
||||
|
||||
extern crate alloc;
|
||||
|
||||
use alloc::boxed::Box;
|
||||
use alloc::rc::Rc;
|
||||
use core::cell::RefCell;
|
||||
use core::fmt;
|
||||
use core::future::Future;
|
||||
use core::pin::Pin;
|
||||
use core::task::{Context, Poll, Waker};
|
||||
use js_sys::Promise;
|
||||
use std::cell::RefCell;
|
||||
use std::fmt;
|
||||
use std::future::Future;
|
||||
use std::pin::Pin;
|
||||
use std::rc::Rc;
|
||||
use std::task::{Context, Poll, Waker};
|
||||
use wasm_bindgen::prelude::*;
|
||||
|
||||
mod queue;
|
||||
|
@ -1,7 +1,7 @@
|
||||
use alloc::collections::VecDeque;
|
||||
use alloc::rc::Rc;
|
||||
use core::cell::{Cell, RefCell};
|
||||
use js_sys::Promise;
|
||||
use std::cell::{Cell, RefCell};
|
||||
use std::collections::VecDeque;
|
||||
use std::rc::Rc;
|
||||
use wasm_bindgen::prelude::*;
|
||||
|
||||
#[wasm_bindgen]
|
||||
@ -71,6 +71,7 @@ impl Queue {
|
||||
}
|
||||
}
|
||||
// Append a task to the currently running queue, or schedule it
|
||||
#[cfg(not(target_feature = "atomics"))]
|
||||
pub(crate) fn push_task(&self, task: Rc<crate::task::Task>) {
|
||||
// It would make sense to run this task on the same tick. For now, we
|
||||
// make the simplifying choice of always scheduling tasks for a future tick.
|
||||
@ -105,8 +106,23 @@ impl Queue {
|
||||
has_queue_microtask,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
thread_local! {
|
||||
pub(crate) static QUEUE: Queue = Queue::new();
|
||||
#[cfg(feature = "std")]
|
||||
pub(crate) fn with<R>(f: impl FnOnce(&Self) -> R) -> R {
|
||||
thread_local! {
|
||||
static QUEUE: Queue = Queue::new();
|
||||
}
|
||||
|
||||
QUEUE.with(f)
|
||||
}
|
||||
|
||||
#[cfg(not(feature = "std"))]
|
||||
pub(crate) fn with<R>(f: impl FnOnce(&Self) -> R) -> R {
|
||||
use wasm_bindgen::__rt::LazyCell;
|
||||
|
||||
#[cfg_attr(target_feature = "atomics", thread_local)]
|
||||
static QUEUE: LazyCell<Queue> = LazyCell::new(Queue::new);
|
||||
|
||||
f(&QUEUE)
|
||||
}
|
||||
}
|
||||
|
@ -1,12 +1,15 @@
|
||||
use std::cell::RefCell;
|
||||
use std::future::Future;
|
||||
use std::mem::ManuallyDrop;
|
||||
use std::pin::Pin;
|
||||
use std::rc::Rc;
|
||||
use std::sync::atomic::AtomicI32;
|
||||
use std::sync::atomic::Ordering::SeqCst;
|
||||
use std::sync::Arc;
|
||||
use std::task::{Context, Poll, RawWaker, RawWakerVTable, Waker};
|
||||
#![allow(clippy::incompatible_msrv)]
|
||||
|
||||
use alloc::boxed::Box;
|
||||
use alloc::rc::Rc;
|
||||
use alloc::sync::Arc;
|
||||
use core::cell::RefCell;
|
||||
use core::future::Future;
|
||||
use core::mem::ManuallyDrop;
|
||||
use core::pin::Pin;
|
||||
use core::sync::atomic::AtomicI32;
|
||||
use core::sync::atomic::Ordering::SeqCst;
|
||||
use core::task::{Context, Poll, RawWaker, RawWakerVTable, Waker};
|
||||
use wasm_bindgen::prelude::*;
|
||||
|
||||
const SLEEPING: i32 = 0;
|
||||
@ -101,7 +104,7 @@ impl Task {
|
||||
*this.inner.borrow_mut() = Some(Inner { future, closure });
|
||||
|
||||
// Queue up the Future's work to happen on the next microtask tick.
|
||||
crate::queue::QUEUE.with(move |queue| queue.schedule_task(this));
|
||||
crate::queue::Queue::with(move |queue| queue.schedule_task(this));
|
||||
}
|
||||
|
||||
pub(crate) fn run(&self) {
|
||||
|
@ -1,9 +1,10 @@
|
||||
use std::cell::{Cell, RefCell};
|
||||
use std::future::Future;
|
||||
use std::mem::ManuallyDrop;
|
||||
use std::pin::Pin;
|
||||
use std::rc::Rc;
|
||||
use std::task::{Context, RawWaker, RawWakerVTable, Waker};
|
||||
use alloc::boxed::Box;
|
||||
use alloc::rc::Rc;
|
||||
use core::cell::{Cell, RefCell};
|
||||
use core::future::Future;
|
||||
use core::mem::ManuallyDrop;
|
||||
use core::pin::Pin;
|
||||
use core::task::{Context, RawWaker, RawWakerVTable, Waker};
|
||||
|
||||
struct Inner {
|
||||
future: Pin<Box<dyn Future<Output = ()> + 'static>>,
|
||||
@ -32,11 +33,11 @@ impl Task {
|
||||
|
||||
*this.inner.borrow_mut() = Some(Inner { future, waker });
|
||||
|
||||
crate::queue::QUEUE.with(|queue| queue.schedule_task(this));
|
||||
crate::queue::Queue::with(|queue| queue.schedule_task(this));
|
||||
}
|
||||
|
||||
fn force_wake(this: Rc<Self>) {
|
||||
crate::queue::QUEUE.with(|queue| {
|
||||
crate::queue::Queue::with(|queue| {
|
||||
queue.push_task(this);
|
||||
});
|
||||
}
|
||||
|
@ -3,6 +3,8 @@
|
||||
//! and ported to Rust
|
||||
//!
|
||||
|
||||
#![allow(clippy::incompatible_msrv)]
|
||||
|
||||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
@ -36,18 +38,37 @@
|
||||
* when possible. The worker communicates with its parent using postMessage.
|
||||
*/
|
||||
|
||||
use alloc::vec;
|
||||
use alloc::vec::Vec;
|
||||
use core::cell::RefCell;
|
||||
use core::sync::atomic::AtomicI32;
|
||||
use js_sys::{Array, Promise};
|
||||
use std::cell::RefCell;
|
||||
use std::sync::atomic::AtomicI32;
|
||||
use wasm_bindgen::prelude::*;
|
||||
use web_sys::{MessageEvent, Worker};
|
||||
|
||||
thread_local! {
|
||||
static HELPERS: RefCell<Vec<Worker>> = RefCell::new(vec![]);
|
||||
struct Helpers;
|
||||
|
||||
impl Helpers {
|
||||
#[cfg(feature = "std")]
|
||||
pub(crate) fn with<R>(f: impl FnOnce(&RefCell<Vec<Worker>>) -> R) -> R {
|
||||
thread_local! {
|
||||
static HELPERS: RefCell<Vec<Worker>> = RefCell::new(vec![]);
|
||||
}
|
||||
|
||||
HELPERS.with(f)
|
||||
}
|
||||
|
||||
#[cfg(not(feature = "std"))]
|
||||
pub(crate) fn with<R>(f: impl FnOnce(&RefCell<Vec<Worker>>) -> R) -> R {
|
||||
#[thread_local]
|
||||
static HELPERS: RefCell<Vec<Worker>> = RefCell::new(vec![]);
|
||||
|
||||
f(&HELPERS)
|
||||
}
|
||||
}
|
||||
|
||||
fn alloc_helper() -> Worker {
|
||||
HELPERS.with(|helpers| {
|
||||
Helpers::with(|helpers| {
|
||||
if let Some(helper) = helpers.borrow_mut().pop() {
|
||||
return helper;
|
||||
}
|
||||
@ -58,7 +79,7 @@ fn alloc_helper() -> Worker {
|
||||
}
|
||||
|
||||
fn free_helper(helper: Worker) {
|
||||
HELPERS.with(move |helpers| {
|
||||
Helpers::with(move |helpers| {
|
||||
let mut helpers = helpers.borrow_mut();
|
||||
helpers.push(helper.clone());
|
||||
helpers.truncate(10); // random arbitrary limit chosen here
|
||||
|
@ -20,8 +20,12 @@ version = "0.3.72"
|
||||
doctest = false
|
||||
test = false
|
||||
|
||||
[features]
|
||||
default = ["std"]
|
||||
std = ["wasm-bindgen/std"]
|
||||
|
||||
[dependencies]
|
||||
wasm-bindgen = { path = "../..", version = "0.2.95" }
|
||||
wasm-bindgen = { path = "../..", version = "0.2.95", default-features = false }
|
||||
|
||||
[target.'cfg(target_arch = "wasm32")'.dev-dependencies]
|
||||
wasm-bindgen-futures = { path = '../futures' }
|
||||
|
@ -17,16 +17,25 @@
|
||||
//! bindings.
|
||||
|
||||
#![doc(html_root_url = "https://docs.rs/js-sys/0.2")]
|
||||
#![cfg_attr(not(feature = "std"), no_std)]
|
||||
#![cfg_attr(
|
||||
all(not(feature = "std"), target_feature = "atomics"),
|
||||
feature(thread_local)
|
||||
)]
|
||||
|
||||
extern crate alloc;
|
||||
|
||||
use alloc::string::String;
|
||||
use alloc::vec::Vec;
|
||||
use core::cmp::Ordering;
|
||||
use core::convert::{self, Infallible, TryFrom};
|
||||
use core::f64;
|
||||
use core::fmt;
|
||||
use core::iter::{self, Product, Sum};
|
||||
use core::mem;
|
||||
use core::ops::{Add, BitAnd, BitOr, BitXor, Div, Mul, Neg, Not, Rem, Shl, Shr, Sub};
|
||||
use std::cmp::Ordering;
|
||||
use std::convert::{self, Infallible, TryFrom};
|
||||
use std::f64;
|
||||
use std::fmt;
|
||||
use std::iter::{self, Product, Sum};
|
||||
use std::mem;
|
||||
use std::str;
|
||||
use std::str::FromStr;
|
||||
use core::str;
|
||||
use core::str::FromStr;
|
||||
|
||||
pub use wasm_bindgen;
|
||||
use wasm_bindgen::prelude::*;
|
||||
@ -636,11 +645,11 @@ extern "C" {
|
||||
/// Iterator returned by `Array::into_iter`
|
||||
#[derive(Debug, Clone)]
|
||||
pub struct ArrayIntoIter {
|
||||
range: std::ops::Range<u32>,
|
||||
range: core::ops::Range<u32>,
|
||||
array: Array,
|
||||
}
|
||||
|
||||
impl std::iter::Iterator for ArrayIntoIter {
|
||||
impl core::iter::Iterator for ArrayIntoIter {
|
||||
type Item = JsValue;
|
||||
|
||||
fn next(&mut self) -> Option<Self::Item> {
|
||||
@ -676,7 +685,7 @@ impl std::iter::Iterator for ArrayIntoIter {
|
||||
}
|
||||
}
|
||||
|
||||
impl std::iter::DoubleEndedIterator for ArrayIntoIter {
|
||||
impl core::iter::DoubleEndedIterator for ArrayIntoIter {
|
||||
fn next_back(&mut self) -> Option<Self::Item> {
|
||||
let index = self.range.next_back()?;
|
||||
Some(self.array.get(index))
|
||||
@ -687,18 +696,18 @@ impl std::iter::DoubleEndedIterator for ArrayIntoIter {
|
||||
}
|
||||
}
|
||||
|
||||
impl std::iter::FusedIterator for ArrayIntoIter {}
|
||||
impl core::iter::FusedIterator for ArrayIntoIter {}
|
||||
|
||||
impl std::iter::ExactSizeIterator for ArrayIntoIter {}
|
||||
impl core::iter::ExactSizeIterator for ArrayIntoIter {}
|
||||
|
||||
/// Iterator returned by `Array::iter`
|
||||
#[derive(Debug, Clone)]
|
||||
pub struct ArrayIter<'a> {
|
||||
range: std::ops::Range<u32>,
|
||||
range: core::ops::Range<u32>,
|
||||
array: &'a Array,
|
||||
}
|
||||
|
||||
impl<'a> std::iter::Iterator for ArrayIter<'a> {
|
||||
impl<'a> core::iter::Iterator for ArrayIter<'a> {
|
||||
type Item = JsValue;
|
||||
|
||||
fn next(&mut self) -> Option<Self::Item> {
|
||||
@ -734,7 +743,7 @@ impl<'a> std::iter::Iterator for ArrayIter<'a> {
|
||||
}
|
||||
}
|
||||
|
||||
impl<'a> std::iter::DoubleEndedIterator for ArrayIter<'a> {
|
||||
impl<'a> core::iter::DoubleEndedIterator for ArrayIter<'a> {
|
||||
fn next_back(&mut self) -> Option<Self::Item> {
|
||||
let index = self.range.next_back()?;
|
||||
Some(self.array.get(index))
|
||||
@ -745,9 +754,9 @@ impl<'a> std::iter::DoubleEndedIterator for ArrayIter<'a> {
|
||||
}
|
||||
}
|
||||
|
||||
impl<'a> std::iter::FusedIterator for ArrayIter<'a> {}
|
||||
impl<'a> core::iter::FusedIterator for ArrayIter<'a> {}
|
||||
|
||||
impl<'a> std::iter::ExactSizeIterator for ArrayIter<'a> {}
|
||||
impl<'a> core::iter::ExactSizeIterator for ArrayIter<'a> {}
|
||||
|
||||
impl Array {
|
||||
/// Returns an iterator over the values of the JS array.
|
||||
@ -772,7 +781,7 @@ impl Array {
|
||||
}
|
||||
}
|
||||
|
||||
impl std::iter::IntoIterator for Array {
|
||||
impl core::iter::IntoIterator for Array {
|
||||
type Item = JsValue;
|
||||
type IntoIter = ArrayIntoIter;
|
||||
|
||||
@ -785,7 +794,7 @@ impl std::iter::IntoIterator for Array {
|
||||
}
|
||||
|
||||
// TODO pre-initialize the Array with the correct length using TrustedLen
|
||||
impl<A> std::iter::FromIterator<A> for Array
|
||||
impl<A> core::iter::FromIterator<A> for Array
|
||||
where
|
||||
A: AsRef<JsValue>,
|
||||
{
|
||||
@ -799,7 +808,7 @@ where
|
||||
}
|
||||
}
|
||||
|
||||
impl<A> std::iter::Extend<A> for Array
|
||||
impl<A> core::iter::Extend<A> for Array
|
||||
where
|
||||
A: AsRef<JsValue>,
|
||||
{
|
||||
@ -2302,7 +2311,7 @@ impl<'a> IntoIterator for &'a Iterator {
|
||||
}
|
||||
}
|
||||
|
||||
impl<'a> std::iter::Iterator for Iter<'a> {
|
||||
impl<'a> core::iter::Iterator for Iter<'a> {
|
||||
type Item = Result<JsValue, JsValue>;
|
||||
|
||||
fn next(&mut self) -> Option<Self::Item> {
|
||||
@ -2322,7 +2331,7 @@ impl IntoIterator for Iterator {
|
||||
}
|
||||
}
|
||||
|
||||
impl std::iter::Iterator for IntoIter {
|
||||
impl core::iter::Iterator for IntoIter {
|
||||
type Item = Result<JsValue, JsValue>;
|
||||
|
||||
fn next(&mut self) -> Option<Self::Item> {
|
||||
@ -2836,6 +2845,7 @@ impl fmt::Display for TryFromIntError {
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(feature = "std")]
|
||||
impl std::error::Error for TryFromIntError {}
|
||||
|
||||
macro_rules! number_try_from {
|
||||
@ -5340,7 +5350,7 @@ impl JsString {
|
||||
///
|
||||
/// [docs]: https://rustwasm.github.io/docs/wasm-bindgen/reference/types/str.html
|
||||
pub fn is_valid_utf16(&self) -> bool {
|
||||
std::char::decode_utf16(self.iter()).all(|i| i.is_ok())
|
||||
core::char::decode_utf16(self.iter()).all(|i| i.is_ok())
|
||||
}
|
||||
|
||||
/// Returns an iterator over the `u16` character codes that make up this JS
|
||||
@ -5375,7 +5385,7 @@ impl JsString {
|
||||
// https://github.com/rustwasm/wasm-bindgen/issues/1362
|
||||
let cp = self.code_point_at(0).as_f64().unwrap_throw() as u32;
|
||||
|
||||
let c = std::char::from_u32(cp)?;
|
||||
let c = core::char::from_u32(cp)?;
|
||||
|
||||
if c.len_utf16() as u32 == len {
|
||||
Some(c)
|
||||
@ -6021,9 +6031,20 @@ extern "C" {
|
||||
/// This allows access to the global properties and global names by accessing
|
||||
/// the `Object` returned.
|
||||
pub fn global() -> Object {
|
||||
thread_local!(static GLOBAL: Object = get_global_object());
|
||||
#[cfg(feature = "std")]
|
||||
{
|
||||
thread_local!(static GLOBAL: Object = get_global_object());
|
||||
return GLOBAL.with(|g| g.clone());
|
||||
}
|
||||
#[cfg(not(feature = "std"))]
|
||||
{
|
||||
use wasm_bindgen::__rt::LazyCell;
|
||||
|
||||
return GLOBAL.with(|g| g.clone());
|
||||
#[cfg_attr(target_feature = "atomics", thread_local)]
|
||||
static GLOBAL: LazyCell<Object> = LazyCell::new(get_global_object);
|
||||
|
||||
return GLOBAL.clone();
|
||||
}
|
||||
|
||||
fn get_global_object() -> Object {
|
||||
// This is a bit wonky, but we're basically using `#[wasm_bindgen]`
|
||||
@ -6230,7 +6251,7 @@ macro_rules! arrays {
|
||||
/// This function returns a new typed array which is a view into
|
||||
/// wasm's memory. This view does not copy the underlying data.
|
||||
///
|
||||
/// # Unsafety
|
||||
/// # Safety
|
||||
///
|
||||
/// Views into WebAssembly memory are only valid so long as the
|
||||
/// backing buffer isn't resized in JS. Once this function is called
|
||||
@ -6259,7 +6280,7 @@ macro_rules! arrays {
|
||||
/// This function returns a new typed array which is a view into
|
||||
/// wasm's memory. This view does not copy the underlying data.
|
||||
///
|
||||
/// # Unsafety
|
||||
/// # Safety
|
||||
///
|
||||
/// Views into WebAssembly memory are only valid so long as the
|
||||
/// backing buffer isn't resized in JS. Once this function is called
|
||||
@ -6286,7 +6307,7 @@ macro_rules! arrays {
|
||||
/// array into this Wasm module's own linear memory, initializing
|
||||
/// the memory destination provided.
|
||||
///
|
||||
/// # Unsafety
|
||||
/// # Safety
|
||||
///
|
||||
/// This function requires `dst` to point to a buffer
|
||||
/// large enough to fit this array's contents.
|
||||
@ -6310,7 +6331,7 @@ macro_rules! arrays {
|
||||
/// This function will panic if this typed array's length is
|
||||
/// different than the length of the provided `dst` array.
|
||||
pub fn copy_to(&self, dst: &mut [$ty]) {
|
||||
assert_eq!(self.length() as usize, dst.len());
|
||||
core::assert_eq!(self.length() as usize, dst.len());
|
||||
unsafe { self.raw_copy_to_ptr(dst.as_mut_ptr()); }
|
||||
}
|
||||
|
||||
@ -6325,7 +6346,7 @@ macro_rules! arrays {
|
||||
/// This function will panic if this typed array's length is
|
||||
/// different than the length of the provided `src` array.
|
||||
pub fn copy_from(&self, src: &[$ty]) {
|
||||
assert_eq!(self.length() as usize, src.len());
|
||||
core::assert_eq!(self.length() as usize, src.len());
|
||||
// This is safe because the `set` function copies from its TypedArray argument
|
||||
unsafe { self.set(&$name::view(src), 0) }
|
||||
}
|
||||
|
@ -5,13 +5,13 @@ use wasm_bindgen_test::*;
|
||||
|
||||
#[wasm_bindgen]
|
||||
extern "C" {
|
||||
#[wasm_bindgen(thread_local, js_name = max, js_namespace = Math)]
|
||||
#[wasm_bindgen(thread_local_v2, js_name = max, js_namespace = Math)]
|
||||
static MAX: Function;
|
||||
|
||||
type ArrayPrototype;
|
||||
#[wasm_bindgen(method, getter, structural)]
|
||||
pub fn push(this: &ArrayPrototype) -> Function;
|
||||
#[wasm_bindgen(thread_local, js_name = prototype, js_namespace = Array)]
|
||||
#[wasm_bindgen(thread_local_v2, js_name = prototype, js_namespace = Array)]
|
||||
static ARRAY_PROTOTYPE2: ArrayPrototype;
|
||||
}
|
||||
|
||||
|
@ -9,9 +9,9 @@ extern "C" {
|
||||
#[wasm_bindgen(method, setter, structural)]
|
||||
fn set_foo(this: &Foo42, val: JsValue);
|
||||
|
||||
#[wasm_bindgen(thread_local, js_name = prototype, js_namespace = Object)]
|
||||
#[wasm_bindgen(thread_local_v2, js_name = prototype, js_namespace = Object)]
|
||||
static OBJECT_PROTOTYPE: JsValue;
|
||||
#[wasm_bindgen(thread_local, js_name = prototype, js_namespace = Array)]
|
||||
#[wasm_bindgen(thread_local_v2, js_name = prototype, js_namespace = Array)]
|
||||
static ARRAY_PROTOTYPE: JsValue;
|
||||
|
||||
type DefinePropertyAttrs;
|
||||
@ -32,9 +32,9 @@ extern "C" {
|
||||
#[wasm_bindgen(constructor)]
|
||||
fn new() -> Foo;
|
||||
|
||||
#[wasm_bindgen(thread_local, js_name = prototype, js_namespace = Foo)]
|
||||
#[wasm_bindgen(thread_local_v2, js_name = prototype, js_namespace = Foo)]
|
||||
static FOO_PROTOTYPE: Object;
|
||||
#[wasm_bindgen(thread_local, js_name = prototype, js_namespace = Bar)]
|
||||
#[wasm_bindgen(thread_local_v2, js_name = prototype, js_namespace = Bar)]
|
||||
static BAR_PROTOTYPE: Object;
|
||||
}
|
||||
|
||||
|
@ -14,13 +14,16 @@ rust-version = "1.57"
|
||||
version = "0.2.95"
|
||||
|
||||
[features]
|
||||
atomics = ["wasm-bindgen-backend/atomics"]
|
||||
default = ["std"]
|
||||
extra-traits = ["syn/extra-traits"]
|
||||
spans = ["wasm-bindgen-backend/spans"]
|
||||
std = ["wasm-bindgen-backend/std"]
|
||||
strict-macro = []
|
||||
|
||||
[dependencies]
|
||||
proc-macro2 = "1.0"
|
||||
quote = '1.0'
|
||||
syn = { version = '2.0', features = ['visit', 'visit-mut', 'full'] }
|
||||
wasm-bindgen-backend = { path = "../backend", version = "=0.2.95" }
|
||||
wasm-bindgen-backend = { path = "../backend", version = "=0.2.95", default-features = false }
|
||||
wasm-bindgen-shared = { path = "../shared", version = "=0.2.95" }
|
||||
|
@ -4,7 +4,7 @@ use std::collections::HashMap;
|
||||
use std::str::Chars;
|
||||
|
||||
use ast::OperationKind;
|
||||
use backend::ast;
|
||||
use backend::ast::{self, ThreadLocal};
|
||||
use backend::util::{ident_ty, ShortHash};
|
||||
use backend::Diagnostic;
|
||||
use proc_macro2::{Ident, Span, TokenStream, TokenTree};
|
||||
@ -96,6 +96,7 @@ macro_rules! attrgen {
|
||||
(getter_with_clone, GetterWithClone(Span)),
|
||||
(static_string, StaticString(Span)),
|
||||
(thread_local, ThreadLocal(Span)),
|
||||
(thread_local_v2, ThreadLocalV2(Span)),
|
||||
|
||||
// For testing purposes only.
|
||||
(assert_no_shim, AssertNoShim(Span)),
|
||||
@ -236,6 +237,23 @@ impl BindgenAttrs {
|
||||
}
|
||||
}
|
||||
|
||||
fn get_thread_local(&self) -> Result<Option<ThreadLocal>, Diagnostic> {
|
||||
let mut thread_local = self.thread_local_v2().map(|_| ThreadLocal::V2);
|
||||
|
||||
if let Some(span) = self.thread_local() {
|
||||
if thread_local.is_some() {
|
||||
return Err(Diagnostic::span_error(
|
||||
*span,
|
||||
"`thread_local` can't be used with `thread_local_v2`",
|
||||
));
|
||||
} else {
|
||||
thread_local = Some(ThreadLocal::V1)
|
||||
}
|
||||
}
|
||||
|
||||
Ok(thread_local)
|
||||
}
|
||||
|
||||
attrgen!(methods);
|
||||
}
|
||||
|
||||
@ -778,7 +796,7 @@ impl<'a> ConvertToAst<(&ast::Program, BindgenAttrs, &'a Option<ast::ImportModule
|
||||
self.ident,
|
||||
ShortHash((&js_name, module, &self.ident)),
|
||||
);
|
||||
let thread_local = opts.thread_local().is_some();
|
||||
let thread_local = opts.get_thread_local()?;
|
||||
|
||||
opts.check_used();
|
||||
Ok(ast::ImportKind::Static(ast::ImportStatic {
|
||||
@ -826,12 +844,14 @@ impl<'a> ConvertToAst<(&ast::Program, BindgenAttrs, &'a Option<ast::ImportModule
|
||||
)
|
||||
}
|
||||
|
||||
if opts.thread_local().is_none() {
|
||||
let thread_local = if let Some(thread_local) = opts.get_thread_local()? {
|
||||
thread_local
|
||||
} else {
|
||||
bail_span!(
|
||||
self,
|
||||
"static strings require `#[wasm_bindgen(thread_local)]`"
|
||||
"static strings require `#[wasm_bindgen(thread_local_v2)]`"
|
||||
)
|
||||
}
|
||||
};
|
||||
|
||||
let shim = format!(
|
||||
"__wbg_string_{}_{}",
|
||||
@ -847,6 +867,7 @@ impl<'a> ConvertToAst<(&ast::Program, BindgenAttrs, &'a Option<ast::ImportModule
|
||||
wasm_bindgen: program.wasm_bindgen.clone(),
|
||||
js_sys: program.js_sys.clone(),
|
||||
string,
|
||||
thread_local,
|
||||
}))
|
||||
}
|
||||
}
|
||||
|
@ -17,13 +17,16 @@ version = "0.2.95"
|
||||
proc-macro = true
|
||||
|
||||
[features]
|
||||
atomics = ["wasm-bindgen-macro-support/atomics"]
|
||||
default = ["std"]
|
||||
spans = ["wasm-bindgen-macro-support/spans"]
|
||||
std = ["wasm-bindgen-macro-support/std"]
|
||||
strict-macro = ["wasm-bindgen-macro-support/strict-macro"]
|
||||
xxx_debug_only_print_generated_code = []
|
||||
|
||||
[dependencies]
|
||||
quote = "1.0"
|
||||
wasm-bindgen-macro-support = { path = "../macro-support", version = "=0.2.95" }
|
||||
wasm-bindgen-macro-support = { path = "../macro-support", version = "=0.2.95", default-features = false }
|
||||
|
||||
[dev-dependencies]
|
||||
js-sys = { path = "../js-sys" }
|
||||
|
@ -1,6 +1,9 @@
|
||||
#![doc(html_root_url = "https://docs.rs/wasm-bindgen-macro/0.2")]
|
||||
#![cfg_attr(
|
||||
wasm_bindgen_unstable_test_coverage,
|
||||
any(
|
||||
wasm_bindgen_unstable_test_coverage,
|
||||
all(not(feature = "std"), feature = "atomics")
|
||||
),
|
||||
feature(allow_internal_unstable),
|
||||
allow(internal_features)
|
||||
)]
|
||||
@ -15,6 +18,10 @@ use quote::quote;
|
||||
wasm_bindgen_unstable_test_coverage,
|
||||
allow_internal_unstable(coverage_attribute)
|
||||
)]
|
||||
#[cfg_attr(
|
||||
all(not(feature = "std"), feature = "atomics"),
|
||||
allow_internal_unstable(thread_local)
|
||||
)]
|
||||
pub fn wasm_bindgen(attr: TokenStream, input: TokenStream) -> TokenStream {
|
||||
match wasm_bindgen_macro_support::expand(attr.into(), input.into()) {
|
||||
Ok(tokens) => {
|
||||
|
@ -17,7 +17,7 @@ extern "C" {
|
||||
#[wasm_bindgen(static_string)]
|
||||
static FOO2: JsString;
|
||||
|
||||
#[wasm_bindgen(thread_local, static_string)]
|
||||
#[wasm_bindgen(thread_local_v2, static_string)]
|
||||
static FOO3: JsString;
|
||||
|
||||
static FOO4: JsString = "test";
|
||||
|
@ -29,10 +29,10 @@ error: static strings require a string literal
|
||||
| ^^^^^^^^^^^^^
|
||||
|
||||
error: static strings require a string literal
|
||||
--> $DIR/invalid-items.rs:20:34
|
||||
--> $DIR/invalid-items.rs:20:37
|
||||
|
|
||||
20 | #[wasm_bindgen(thread_local, static_string)]
|
||||
| ^^^^^^^^^^^^^
|
||||
20 | #[wasm_bindgen(thread_local_v2, static_string)]
|
||||
| ^^^^^^^^^^^^^
|
||||
|
||||
error: static strings require `#[wasm_bindgen(static_string)]`
|
||||
--> $DIR/invalid-items.rs:23:5
|
||||
@ -40,7 +40,7 @@ error: static strings require `#[wasm_bindgen(static_string)]`
|
||||
23 | static FOO4: JsString = "test";
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error: static strings require `#[wasm_bindgen(thread_local)]`
|
||||
error: static strings require `#[wasm_bindgen(thread_local_v2)]`
|
||||
--> $DIR/invalid-items.rs:26:5
|
||||
|
|
||||
26 | static FOO5: JsString = "test";
|
||||
|
@ -3,7 +3,7 @@ use wasm_bindgen::prelude::*;
|
||||
#[wasm_bindgen]
|
||||
#[rustfmt::skip]
|
||||
extern "C" {
|
||||
#[wasm_bindgen(thread_local, static_string)]
|
||||
#[wasm_bindgen(thread_local_v2, static_string)]
|
||||
static FOO: JsValue = "test";
|
||||
}
|
||||
|
||||
|
@ -113,7 +113,7 @@ pub fn wasm_bindgen_test(
|
||||
quote! {
|
||||
const _: () = {
|
||||
#[no_mangle]
|
||||
#[cfg(all(target_arch = "wasm32", target_os = "unknown"))]
|
||||
#[cfg(all(target_arch = "wasm32", any(target_os = "unknown", target_os = "none")))]
|
||||
#[cfg_attr(wasm_bindgen_unstable_test_coverage, coverage(off))]
|
||||
pub extern "C" fn #name(cx: &#wasm_bindgen_path::__rt::Context) {
|
||||
let test_name = ::core::concat!(::core::module_path!(), "::", ::core::stringify!(#ident));
|
||||
@ -125,7 +125,7 @@ pub fn wasm_bindgen_test(
|
||||
|
||||
if let Some(path) = attributes.unsupported {
|
||||
tokens.extend(
|
||||
quote! { #[cfg_attr(not(all(target_arch = "wasm32", target_os = "unknown")), #path)] },
|
||||
quote! { #[cfg_attr(not(all(target_arch = "wasm32", any(target_os = "unknown", target_os = "none"))), #path)] },
|
||||
);
|
||||
|
||||
if let Some(should_panic) = should_panic {
|
||||
@ -136,7 +136,7 @@ pub fn wasm_bindgen_test(
|
||||
};
|
||||
|
||||
tokens.extend(
|
||||
quote! { #[cfg_attr(not(all(target_arch = "wasm32", target_os = "unknown")), #should_panic)] }
|
||||
quote! { #[cfg_attr(not(all(target_arch = "wasm32", any(target_os = "unknown", target_os = "none"))), #should_panic)] }
|
||||
)
|
||||
}
|
||||
}
|
||||
|
@ -9,13 +9,17 @@ repository = "https://github.com/rustwasm/wasm-bindgen"
|
||||
rust-version = "1.57"
|
||||
version = "0.3.45"
|
||||
|
||||
[features]
|
||||
default = ["std"]
|
||||
std = ["wasm-bindgen/std", "js-sys/std", "wasm-bindgen-futures/std", "once_cell/std", "scoped-tls"]
|
||||
|
||||
[dependencies]
|
||||
console_error_panic_hook = '0.1'
|
||||
gg-alloc = { version = "1.0", optional = true }
|
||||
js-sys = { path = '../js-sys', version = '0.3.72' }
|
||||
scoped-tls = "1.0"
|
||||
wasm-bindgen = { path = '../..', version = '0.2.95' }
|
||||
wasm-bindgen-futures = { path = '../futures', version = '0.4.45' }
|
||||
js-sys = { path = '../js-sys', version = '0.3.72', default-features = false }
|
||||
once_cell = { version = "1.12", default-features = false }
|
||||
scoped-tls = { version = "1.0", optional = true }
|
||||
wasm-bindgen = { path = '../..', version = '0.2.95', default-features = false }
|
||||
wasm-bindgen-futures = { path = '../futures', version = '0.4.45', default-features = false }
|
||||
wasm-bindgen-test-macro = { path = '../test-macro', version = '=0.3.45' }
|
||||
|
||||
[target.'cfg(all(target_arch = "wasm32", wasm_bindgen_unstable_test_coverage))'.dependencies]
|
||||
|
@ -1,3 +1,4 @@
|
||||
use alloc::vec::Vec;
|
||||
use wasm_bindgen::prelude::wasm_bindgen;
|
||||
|
||||
#[cfg(wasm_bindgen_unstable_test_coverage)]
|
||||
|
@ -2,8 +2,13 @@
|
||||
//!
|
||||
//! More documentation can be found in the README for this crate!
|
||||
|
||||
#![cfg_attr(not(feature = "std"), no_std)]
|
||||
#![deny(missing_docs)]
|
||||
|
||||
extern crate alloc;
|
||||
|
||||
#[cfg(feature = "std")]
|
||||
use scoped_tls::scoped_thread_local;
|
||||
pub use wasm_bindgen_test_macro::wasm_bindgen_test;
|
||||
|
||||
// Custom allocator that only returns pointers in the 2GB-4GB range
|
||||
|
@ -3,6 +3,8 @@
|
||||
//! Currently this is quite simple, rendering the same as the console tests in
|
||||
//! node.js. Output here is rendered in a `pre`, however.
|
||||
|
||||
use alloc::format;
|
||||
use alloc::string::String;
|
||||
use js_sys::Error;
|
||||
use wasm_bindgen::prelude::*;
|
||||
|
||||
@ -19,7 +21,7 @@ pub struct Browser {
|
||||
#[wasm_bindgen]
|
||||
extern "C" {
|
||||
type HTMLDocument;
|
||||
#[wasm_bindgen(thread_local, js_name = document)]
|
||||
#[wasm_bindgen(thread_local_v2, js_name = document)]
|
||||
static DOCUMENT: HTMLDocument;
|
||||
#[wasm_bindgen(method, structural)]
|
||||
fn getElementById(this: &HTMLDocument, id: &str) -> Element;
|
||||
|
@ -1,5 +1,6 @@
|
||||
//! Runtime detection of whether we're in node.js or a browser.
|
||||
|
||||
use alloc::string::String;
|
||||
use wasm_bindgen::prelude::*;
|
||||
|
||||
#[wasm_bindgen]
|
||||
|
@ -87,14 +87,18 @@
|
||||
// Overall this is all somewhat in flux as it's pretty new, and feedback is
|
||||
// always of course welcome!
|
||||
|
||||
use alloc::borrow::ToOwned;
|
||||
use alloc::boxed::Box;
|
||||
use alloc::format;
|
||||
use alloc::rc::Rc;
|
||||
use alloc::string::{String, ToString};
|
||||
use alloc::vec::Vec;
|
||||
use core::cell::{Cell, RefCell};
|
||||
use core::fmt::{self, Display};
|
||||
use core::future::Future;
|
||||
use core::pin::Pin;
|
||||
use core::task::{self, Poll};
|
||||
use js_sys::{Array, Function, Promise};
|
||||
use std::cell::{Cell, RefCell};
|
||||
use std::fmt::{self, Display};
|
||||
use std::future::Future;
|
||||
use std::pin::Pin;
|
||||
use std::rc::Rc;
|
||||
use std::sync::Once;
|
||||
use std::task::{self, Poll};
|
||||
use wasm_bindgen::prelude::*;
|
||||
use wasm_bindgen_futures::future_to_promise;
|
||||
|
||||
@ -109,6 +113,8 @@ const CONCURRENCY: usize = 1;
|
||||
pub mod browser;
|
||||
pub mod detect;
|
||||
pub mod node;
|
||||
#[cfg(not(feature = "std"))]
|
||||
mod scoped_tls;
|
||||
pub mod worker;
|
||||
|
||||
/// Runtime test harness support instantiated in JS.
|
||||
@ -266,21 +272,56 @@ impl Context {
|
||||
/// coordinated, and this will collect output and results for all executed
|
||||
/// tests.
|
||||
#[wasm_bindgen(constructor)]
|
||||
#[allow(clippy::new_without_default)]
|
||||
pub fn new() -> Context {
|
||||
static SET_HOOK: Once = Once::new();
|
||||
fn panic_handling(mut message: String) {
|
||||
let should_panic = CURRENT_OUTPUT.with(|output| {
|
||||
let mut output = output.borrow_mut();
|
||||
output.panic.push_str(&message);
|
||||
output.should_panic
|
||||
});
|
||||
|
||||
// See https://github.com/rustwasm/console_error_panic_hook/blob/4dc30a5448ed3ffcfb961b1ad54d000cca881b84/src/lib.rs#L83-L123.
|
||||
if !should_panic {
|
||||
#[wasm_bindgen]
|
||||
extern "C" {
|
||||
type Error;
|
||||
|
||||
#[wasm_bindgen(constructor)]
|
||||
fn new() -> Error;
|
||||
|
||||
#[wasm_bindgen(method, getter)]
|
||||
fn stack(error: &Error) -> String;
|
||||
}
|
||||
|
||||
message.push_str("\n\nStack:\n\n");
|
||||
let e = Error::new();
|
||||
let stack = e.stack();
|
||||
message.push_str(&stack);
|
||||
|
||||
message.push_str("\n\n");
|
||||
|
||||
js_console_error(&message);
|
||||
}
|
||||
}
|
||||
#[cfg(feature = "std")]
|
||||
static SET_HOOK: std::sync::Once = std::sync::Once::new();
|
||||
#[cfg(feature = "std")]
|
||||
SET_HOOK.call_once(|| {
|
||||
std::panic::set_hook(Box::new(|panic_info| {
|
||||
let should_panic = CURRENT_OUTPUT.with(|output| {
|
||||
let mut output = output.borrow_mut();
|
||||
output.panic.push_str(&panic_info.to_string());
|
||||
output.should_panic
|
||||
});
|
||||
|
||||
if !should_panic {
|
||||
console_error_panic_hook::hook(panic_info);
|
||||
}
|
||||
panic_handling(panic_info.to_string());
|
||||
}));
|
||||
});
|
||||
#[cfg(all(
|
||||
not(feature = "std"),
|
||||
target_arch = "wasm32",
|
||||
any(target_os = "unknown", target_os = "none")
|
||||
))]
|
||||
#[panic_handler]
|
||||
fn panic_handler(panic_info: &core::panic::PanicInfo<'_>) -> ! {
|
||||
panic_handling(panic_info.to_string());
|
||||
core::arch::wasm32::unreachable();
|
||||
}
|
||||
|
||||
let formatter = match detect::detect() {
|
||||
detect::Runtime::Browser => Box::new(browser::Browser::new()) as Box<dyn Formatter>,
|
||||
@ -379,7 +420,7 @@ impl Context {
|
||||
}
|
||||
}
|
||||
|
||||
scoped_tls::scoped_thread_local!(static CURRENT_OUTPUT: RefCell<Output>);
|
||||
crate::scoped_thread_local!(static CURRENT_OUTPUT: RefCell<Output>);
|
||||
|
||||
/// Handler for `console.log` invocations.
|
||||
///
|
||||
@ -452,7 +493,7 @@ impl Termination for () {
|
||||
}
|
||||
}
|
||||
|
||||
impl<E: std::fmt::Debug> Termination for Result<(), E> {
|
||||
impl<E: core::fmt::Debug> Termination for Result<(), E> {
|
||||
fn into_js_result(self) -> Result<(), JsValue> {
|
||||
self.map_err(|e| JsError::new(&format!("{:?}", e)).into())
|
||||
}
|
||||
|
@ -3,6 +3,8 @@
|
||||
//! This currently uses the same output as `libtest`, only reimplemented here
|
||||
//! for node itself.
|
||||
|
||||
use alloc::format;
|
||||
use alloc::string::String;
|
||||
use wasm_bindgen::prelude::*;
|
||||
|
||||
use super::TestResult;
|
||||
|
85
crates/test/src/rt/scoped_tls.rs
Normal file
85
crates/test/src/rt/scoped_tls.rs
Normal file
@ -0,0 +1,85 @@
|
||||
//! See <https://github.com/alexcrichton/scoped-tls/blob/0b6f66a582340bb3363f21a84b70ff40caa98774/src/lib.rs>.
|
||||
|
||||
use core::cell::Cell;
|
||||
use core::marker::PhantomData;
|
||||
|
||||
/// `no_std` polyfill for [`scoped_tls`](https://crates.io/crates/scoped-tls).
|
||||
#[macro_export]
|
||||
macro_rules! scoped_thread_local {
|
||||
(static $name:ident: $ty:ty) => {
|
||||
static $name: scoped_tls::ScopedKey<$ty> = unsafe {
|
||||
static FOO: scoped_tls::Wrapper<::core::cell::Cell<*const ()>> =
|
||||
scoped_tls::Wrapper::new(::core::cell::Cell::new(::core::ptr::null()));
|
||||
// Safety: nothing else can access FOO since it's hidden in its own scope
|
||||
scoped_tls::ScopedKey::new(&FOO)
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
pub(super) struct Wrapper<T>(T);
|
||||
|
||||
impl<T> Wrapper<T> {
|
||||
pub(super) const fn new(value: T) -> Self {
|
||||
Self(value)
|
||||
}
|
||||
}
|
||||
|
||||
unsafe impl<T> Sync for Wrapper<T> {}
|
||||
|
||||
pub struct ScopedKey<T> {
|
||||
inner: &'static Wrapper<Cell<*const ()>>,
|
||||
_marker: PhantomData<T>,
|
||||
}
|
||||
|
||||
unsafe impl<T> Sync for ScopedKey<T> {}
|
||||
|
||||
impl<T> ScopedKey<T> {
|
||||
#[doc(hidden)]
|
||||
/// # Safety
|
||||
/// `inner` must only be accessed through `ScopedKey`'s API
|
||||
pub const unsafe fn new(inner: &'static Wrapper<Cell<*const ()>>) -> Self {
|
||||
Self {
|
||||
inner,
|
||||
_marker: PhantomData,
|
||||
}
|
||||
}
|
||||
|
||||
pub fn set<F, R>(&'static self, t: &T, f: F) -> R
|
||||
where
|
||||
F: FnOnce() -> R,
|
||||
{
|
||||
struct Reset {
|
||||
key: &'static Wrapper<Cell<*const ()>>,
|
||||
val: *const (),
|
||||
}
|
||||
impl Drop for Reset {
|
||||
fn drop(&mut self) {
|
||||
self.key.0.set(self.val);
|
||||
}
|
||||
}
|
||||
let prev = self.inner.0.get();
|
||||
self.inner.0.set(t as *const T as *const ());
|
||||
let _reset = Reset {
|
||||
key: self.inner,
|
||||
val: prev,
|
||||
};
|
||||
f()
|
||||
}
|
||||
|
||||
pub fn with<F, R>(&'static self, f: F) -> R
|
||||
where
|
||||
F: FnOnce(&T) -> R,
|
||||
{
|
||||
let val = self.inner.0.get();
|
||||
assert!(
|
||||
!val.is_null(),
|
||||
"cannot access a scoped thread local variable without calling `set` first"
|
||||
);
|
||||
unsafe { f(&*(val as *const T)) }
|
||||
}
|
||||
|
||||
/// Test whether this TLS key has been `set` for the current thread.
|
||||
pub fn is_set(&'static self) -> bool {
|
||||
!self.inner.0.get().is_null()
|
||||
}
|
||||
}
|
@ -3,6 +3,8 @@
|
||||
//! Currently this is quite simple, rendering the same as the console tests in
|
||||
//! node.js. Output here is rendered in a `pre`, however.
|
||||
|
||||
use alloc::format;
|
||||
use alloc::string::String;
|
||||
use js_sys::Error;
|
||||
use wasm_bindgen::prelude::*;
|
||||
|
||||
|
@ -23,8 +23,8 @@ doctest = false
|
||||
test = false
|
||||
|
||||
[dependencies]
|
||||
js-sys = { path = '../js-sys', version = '0.3.72' }
|
||||
wasm-bindgen = { path = "../..", version = "0.2.95" }
|
||||
js-sys = { path = '../js-sys', version = '0.3.72', default-features = false }
|
||||
wasm-bindgen = { path = "../..", version = "0.2.95", default-features = false }
|
||||
|
||||
[target.'cfg(target_arch = "wasm32")'.dev-dependencies]
|
||||
futures = "0.3"
|
||||
@ -36,6 +36,8 @@ unexpected_cfgs = { level = "warn", check-cfg = ['cfg(web_sys_unstable_apis)'] }
|
||||
|
||||
# This list is auto-generated by the wasm-bindgen-webidl program
|
||||
[features]
|
||||
default = ["std"]
|
||||
std = ["wasm-bindgen/std", "js-sys/std"]
|
||||
AbortController = []
|
||||
AbortSignal = ["EventTarget"]
|
||||
AddEventListenerOptions = []
|
||||
|
@ -14,7 +14,7 @@ extern "C" {
|
||||
#[doc = ""]
|
||||
#[doc = "*This API requires the following crate features to be activated: `AesCbcParams`*"]
|
||||
#[wasm_bindgen(method, getter = "name")]
|
||||
pub fn get_name(this: &AesCbcParams) -> String;
|
||||
pub fn get_name(this: &AesCbcParams) -> ::alloc::string::String;
|
||||
#[doc = "Change the `name` field of this object."]
|
||||
#[doc = ""]
|
||||
#[doc = "*This API requires the following crate features to be activated: `AesCbcParams`*"]
|
||||
|
@ -14,7 +14,7 @@ extern "C" {
|
||||
#[doc = ""]
|
||||
#[doc = "*This API requires the following crate features to be activated: `AesCtrParams`*"]
|
||||
#[wasm_bindgen(method, getter = "name")]
|
||||
pub fn get_name(this: &AesCtrParams) -> String;
|
||||
pub fn get_name(this: &AesCtrParams) -> ::alloc::string::String;
|
||||
#[doc = "Change the `name` field of this object."]
|
||||
#[doc = ""]
|
||||
#[doc = "*This API requires the following crate features to be activated: `AesCtrParams`*"]
|
||||
|
@ -14,7 +14,7 @@ extern "C" {
|
||||
#[doc = ""]
|
||||
#[doc = "*This API requires the following crate features to be activated: `AesDerivedKeyParams`*"]
|
||||
#[wasm_bindgen(method, getter = "name")]
|
||||
pub fn get_name(this: &AesDerivedKeyParams) -> String;
|
||||
pub fn get_name(this: &AesDerivedKeyParams) -> ::alloc::string::String;
|
||||
#[doc = "Change the `name` field of this object."]
|
||||
#[doc = ""]
|
||||
#[doc = "*This API requires the following crate features to be activated: `AesDerivedKeyParams`*"]
|
||||
|
@ -14,7 +14,7 @@ extern "C" {
|
||||
#[doc = ""]
|
||||
#[doc = "*This API requires the following crate features to be activated: `AesGcmParams`*"]
|
||||
#[wasm_bindgen(method, getter = "name")]
|
||||
pub fn get_name(this: &AesGcmParams) -> String;
|
||||
pub fn get_name(this: &AesGcmParams) -> ::alloc::string::String;
|
||||
#[doc = "Change the `name` field of this object."]
|
||||
#[doc = ""]
|
||||
#[doc = "*This API requires the following crate features to be activated: `AesGcmParams`*"]
|
||||
|
@ -14,7 +14,7 @@ extern "C" {
|
||||
#[doc = ""]
|
||||
#[doc = "*This API requires the following crate features to be activated: `AesKeyAlgorithm`*"]
|
||||
#[wasm_bindgen(method, getter = "name")]
|
||||
pub fn get_name(this: &AesKeyAlgorithm) -> String;
|
||||
pub fn get_name(this: &AesKeyAlgorithm) -> ::alloc::string::String;
|
||||
#[doc = "Change the `name` field of this object."]
|
||||
#[doc = ""]
|
||||
#[doc = "*This API requires the following crate features to be activated: `AesKeyAlgorithm`*"]
|
||||
|
@ -14,7 +14,7 @@ extern "C" {
|
||||
#[doc = ""]
|
||||
#[doc = "*This API requires the following crate features to be activated: `AesKeyGenParams`*"]
|
||||
#[wasm_bindgen(method, getter = "name")]
|
||||
pub fn get_name(this: &AesKeyGenParams) -> String;
|
||||
pub fn get_name(this: &AesKeyGenParams) -> ::alloc::string::String;
|
||||
#[doc = "Change the `name` field of this object."]
|
||||
#[doc = ""]
|
||||
#[doc = "*This API requires the following crate features to be activated: `AesKeyGenParams`*"]
|
||||
|
@ -14,7 +14,7 @@ extern "C" {
|
||||
#[doc = ""]
|
||||
#[doc = "*This API requires the following crate features to be activated: `Algorithm`*"]
|
||||
#[wasm_bindgen(method, getter = "name")]
|
||||
pub fn get_name(this: &Algorithm) -> String;
|
||||
pub fn get_name(this: &Algorithm) -> ::alloc::string::String;
|
||||
#[doc = "Change the `name` field of this object."]
|
||||
#[doc = ""]
|
||||
#[doc = "*This API requires the following crate features to be activated: `Algorithm`*"]
|
||||
|
@ -40,7 +40,7 @@ extern "C" {
|
||||
#[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
|
||||
#[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
|
||||
#[wasm_bindgen(method, getter = "deviceId")]
|
||||
pub fn get_device_id(this: &AllowedBluetoothDevice) -> String;
|
||||
pub fn get_device_id(this: &AllowedBluetoothDevice) -> ::alloc::string::String;
|
||||
#[cfg(web_sys_unstable_apis)]
|
||||
#[doc = "Change the `deviceId` field of this object."]
|
||||
#[doc = ""]
|
||||
|
@ -40,7 +40,7 @@ extern "C" {
|
||||
#[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
|
||||
#[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
|
||||
#[wasm_bindgen(method, getter = "serialNumber")]
|
||||
pub fn get_serial_number(this: &AllowedUsbDevice) -> Option<String>;
|
||||
pub fn get_serial_number(this: &AllowedUsbDevice) -> Option<::alloc::string::String>;
|
||||
#[cfg(web_sys_unstable_apis)]
|
||||
#[doc = "Change the `serialNumber` field of this object."]
|
||||
#[doc = ""]
|
||||
|
@ -18,7 +18,7 @@ extern "C" {
|
||||
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Animation/id)"]
|
||||
#[doc = ""]
|
||||
#[doc = "*This API requires the following crate features to be activated: `Animation`*"]
|
||||
pub fn id(this: &Animation) -> String;
|
||||
pub fn id(this: &Animation) -> ::alloc::string::String;
|
||||
# [wasm_bindgen (structural , method , setter , js_class = "Animation" , js_name = id)]
|
||||
#[doc = "Setter for the `id` field of this object."]
|
||||
#[doc = ""]
|
||||
|
@ -18,7 +18,7 @@ extern "C" {
|
||||
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AnimationEvent/animationName)"]
|
||||
#[doc = ""]
|
||||
#[doc = "*This API requires the following crate features to be activated: `AnimationEvent`*"]
|
||||
pub fn animation_name(this: &AnimationEvent) -> String;
|
||||
pub fn animation_name(this: &AnimationEvent) -> ::alloc::string::String;
|
||||
# [wasm_bindgen (structural , method , getter , js_class = "AnimationEvent" , js_name = elapsedTime)]
|
||||
#[doc = "Getter for the `elapsedTime` field of this object."]
|
||||
#[doc = ""]
|
||||
@ -32,7 +32,7 @@ extern "C" {
|
||||
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AnimationEvent/pseudoElement)"]
|
||||
#[doc = ""]
|
||||
#[doc = "*This API requires the following crate features to be activated: `AnimationEvent`*"]
|
||||
pub fn pseudo_element(this: &AnimationEvent) -> String;
|
||||
pub fn pseudo_element(this: &AnimationEvent) -> ::alloc::string::String;
|
||||
#[wasm_bindgen(catch, constructor, js_class = "AnimationEvent")]
|
||||
#[doc = "The `new AnimationEvent(..)` constructor, creating a new instance of `AnimationEvent`."]
|
||||
#[doc = ""]
|
||||
|
@ -44,7 +44,7 @@ extern "C" {
|
||||
#[doc = ""]
|
||||
#[doc = "*This API requires the following crate features to be activated: `AnimationEventInit`*"]
|
||||
#[wasm_bindgen(method, getter = "animationName")]
|
||||
pub fn get_animation_name(this: &AnimationEventInit) -> Option<String>;
|
||||
pub fn get_animation_name(this: &AnimationEventInit) -> Option<::alloc::string::String>;
|
||||
#[doc = "Change the `animationName` field of this object."]
|
||||
#[doc = ""]
|
||||
#[doc = "*This API requires the following crate features to be activated: `AnimationEventInit`*"]
|
||||
@ -64,7 +64,7 @@ extern "C" {
|
||||
#[doc = ""]
|
||||
#[doc = "*This API requires the following crate features to be activated: `AnimationEventInit`*"]
|
||||
#[wasm_bindgen(method, getter = "pseudoElement")]
|
||||
pub fn get_pseudo_element(this: &AnimationEventInit) -> Option<String>;
|
||||
pub fn get_pseudo_element(this: &AnimationEventInit) -> Option<::alloc::string::String>;
|
||||
#[doc = "Change the `pseudoElement` field of this object."]
|
||||
#[doc = ""]
|
||||
#[doc = "*This API requires the following crate features to be activated: `AnimationEventInit`*"]
|
||||
|
@ -14,7 +14,7 @@ extern "C" {
|
||||
#[doc = ""]
|
||||
#[doc = "*This API requires the following crate features to be activated: `AnimationPropertyDetails`*"]
|
||||
#[wasm_bindgen(method, getter = "property")]
|
||||
pub fn get_property(this: &AnimationPropertyDetails) -> String;
|
||||
pub fn get_property(this: &AnimationPropertyDetails) -> ::alloc::string::String;
|
||||
#[doc = "Change the `property` field of this object."]
|
||||
#[doc = ""]
|
||||
#[doc = "*This API requires the following crate features to be activated: `AnimationPropertyDetails`*"]
|
||||
@ -44,7 +44,7 @@ extern "C" {
|
||||
#[doc = ""]
|
||||
#[doc = "*This API requires the following crate features to be activated: `AnimationPropertyDetails`*"]
|
||||
#[wasm_bindgen(method, getter = "warning")]
|
||||
pub fn get_warning(this: &AnimationPropertyDetails) -> Option<String>;
|
||||
pub fn get_warning(this: &AnimationPropertyDetails) -> Option<::alloc::string::String>;
|
||||
#[doc = "Change the `warning` field of this object."]
|
||||
#[doc = ""]
|
||||
#[doc = "*This API requires the following crate features to be activated: `AnimationPropertyDetails`*"]
|
||||
|
@ -26,7 +26,7 @@ extern "C" {
|
||||
#[doc = ""]
|
||||
#[doc = "*This API requires the following crate features to be activated: `AnimationPropertyValueDetails`*"]
|
||||
#[wasm_bindgen(method, getter = "easing")]
|
||||
pub fn get_easing(this: &AnimationPropertyValueDetails) -> Option<String>;
|
||||
pub fn get_easing(this: &AnimationPropertyValueDetails) -> Option<::alloc::string::String>;
|
||||
#[doc = "Change the `easing` field of this object."]
|
||||
#[doc = ""]
|
||||
#[doc = "*This API requires the following crate features to be activated: `AnimationPropertyValueDetails`*"]
|
||||
@ -46,7 +46,7 @@ extern "C" {
|
||||
#[doc = ""]
|
||||
#[doc = "*This API requires the following crate features to be activated: `AnimationPropertyValueDetails`*"]
|
||||
#[wasm_bindgen(method, getter = "value")]
|
||||
pub fn get_value(this: &AnimationPropertyValueDetails) -> Option<String>;
|
||||
pub fn get_value(this: &AnimationPropertyValueDetails) -> Option<::alloc::string::String>;
|
||||
#[doc = "Change the `value` field of this object."]
|
||||
#[doc = ""]
|
||||
#[doc = "*This API requires the following crate features to be activated: `AnimationPropertyValueDetails`*"]
|
||||
|
@ -18,14 +18,14 @@ extern "C" {
|
||||
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Attr/localName)"]
|
||||
#[doc = ""]
|
||||
#[doc = "*This API requires the following crate features to be activated: `Attr`*"]
|
||||
pub fn local_name(this: &Attr) -> String;
|
||||
pub fn local_name(this: &Attr) -> ::alloc::string::String;
|
||||
# [wasm_bindgen (structural , method , getter , js_class = "Attr" , js_name = value)]
|
||||
#[doc = "Getter for the `value` field of this object."]
|
||||
#[doc = ""]
|
||||
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Attr/value)"]
|
||||
#[doc = ""]
|
||||
#[doc = "*This API requires the following crate features to be activated: `Attr`*"]
|
||||
pub fn value(this: &Attr) -> String;
|
||||
pub fn value(this: &Attr) -> ::alloc::string::String;
|
||||
# [wasm_bindgen (structural , method , setter , js_class = "Attr" , js_name = value)]
|
||||
#[doc = "Setter for the `value` field of this object."]
|
||||
#[doc = ""]
|
||||
@ -39,21 +39,21 @@ extern "C" {
|
||||
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Attr/name)"]
|
||||
#[doc = ""]
|
||||
#[doc = "*This API requires the following crate features to be activated: `Attr`*"]
|
||||
pub fn name(this: &Attr) -> String;
|
||||
pub fn name(this: &Attr) -> ::alloc::string::String;
|
||||
# [wasm_bindgen (structural , method , getter , js_class = "Attr" , js_name = namespaceURI)]
|
||||
#[doc = "Getter for the `namespaceURI` field of this object."]
|
||||
#[doc = ""]
|
||||
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Attr/namespaceURI)"]
|
||||
#[doc = ""]
|
||||
#[doc = "*This API requires the following crate features to be activated: `Attr`*"]
|
||||
pub fn namespace_uri(this: &Attr) -> Option<String>;
|
||||
pub fn namespace_uri(this: &Attr) -> Option<::alloc::string::String>;
|
||||
# [wasm_bindgen (structural , method , getter , js_class = "Attr" , js_name = prefix)]
|
||||
#[doc = "Getter for the `prefix` field of this object."]
|
||||
#[doc = ""]
|
||||
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Attr/prefix)"]
|
||||
#[doc = ""]
|
||||
#[doc = "*This API requires the following crate features to be activated: `Attr`*"]
|
||||
pub fn prefix(this: &Attr) -> Option<String>;
|
||||
pub fn prefix(this: &Attr) -> Option<::alloc::string::String>;
|
||||
# [wasm_bindgen (structural , method , getter , js_class = "Attr" , js_name = specified)]
|
||||
#[doc = "Getter for the `specified` field of this object."]
|
||||
#[doc = ""]
|
||||
|
@ -14,7 +14,7 @@ extern "C" {
|
||||
#[doc = ""]
|
||||
#[doc = "*This API requires the following crate features to be activated: `AttributeNameValue`*"]
|
||||
#[wasm_bindgen(method, getter = "name")]
|
||||
pub fn get_name(this: &AttributeNameValue) -> String;
|
||||
pub fn get_name(this: &AttributeNameValue) -> ::alloc::string::String;
|
||||
#[doc = "Change the `name` field of this object."]
|
||||
#[doc = ""]
|
||||
#[doc = "*This API requires the following crate features to be activated: `AttributeNameValue`*"]
|
||||
@ -24,7 +24,7 @@ extern "C" {
|
||||
#[doc = ""]
|
||||
#[doc = "*This API requires the following crate features to be activated: `AttributeNameValue`*"]
|
||||
#[wasm_bindgen(method, getter = "value")]
|
||||
pub fn get_value(this: &AttributeNameValue) -> String;
|
||||
pub fn get_value(this: &AttributeNameValue) -> ::alloc::string::String;
|
||||
#[doc = "Change the `value` field of this object."]
|
||||
#[doc = ""]
|
||||
#[doc = "*This API requires the following crate features to be activated: `AttributeNameValue`*"]
|
||||
|
@ -24,7 +24,7 @@ extern "C" {
|
||||
#[doc = ""]
|
||||
#[doc = "*This API requires the following crate features to be activated: `AudioConfiguration`*"]
|
||||
#[wasm_bindgen(method, getter = "channels")]
|
||||
pub fn get_channels(this: &AudioConfiguration) -> Option<String>;
|
||||
pub fn get_channels(this: &AudioConfiguration) -> Option<::alloc::string::String>;
|
||||
#[doc = "Change the `channels` field of this object."]
|
||||
#[doc = ""]
|
||||
#[doc = "*This API requires the following crate features to be activated: `AudioConfiguration`*"]
|
||||
@ -34,7 +34,7 @@ extern "C" {
|
||||
#[doc = ""]
|
||||
#[doc = "*This API requires the following crate features to be activated: `AudioConfiguration`*"]
|
||||
#[wasm_bindgen(method, getter = "contentType")]
|
||||
pub fn get_content_type(this: &AudioConfiguration) -> Option<String>;
|
||||
pub fn get_content_type(this: &AudioConfiguration) -> Option<::alloc::string::String>;
|
||||
#[doc = "Change the `contentType` field of this object."]
|
||||
#[doc = ""]
|
||||
#[doc = "*This API requires the following crate features to be activated: `AudioConfiguration`*"]
|
||||
|
@ -22,7 +22,7 @@ extern "C" {
|
||||
#[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
|
||||
#[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
|
||||
#[wasm_bindgen(method, getter = "codec")]
|
||||
pub fn get_codec(this: &AudioDecoderConfig) -> String;
|
||||
pub fn get_codec(this: &AudioDecoderConfig) -> ::alloc::string::String;
|
||||
#[cfg(web_sys_unstable_apis)]
|
||||
#[doc = "Change the `codec` field of this object."]
|
||||
#[doc = ""]
|
||||
|
@ -40,7 +40,7 @@ extern "C" {
|
||||
#[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
|
||||
#[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
|
||||
#[wasm_bindgen(method, getter = "codec")]
|
||||
pub fn get_codec(this: &AudioEncoderConfig) -> String;
|
||||
pub fn get_codec(this: &AudioEncoderConfig) -> ::alloc::string::String;
|
||||
#[cfg(web_sys_unstable_apis)]
|
||||
#[doc = "Change the `codec` field of this object."]
|
||||
#[doc = ""]
|
||||
|
@ -18,28 +18,28 @@ extern "C" {
|
||||
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AudioTrack/id)"]
|
||||
#[doc = ""]
|
||||
#[doc = "*This API requires the following crate features to be activated: `AudioTrack`*"]
|
||||
pub fn id(this: &AudioTrack) -> String;
|
||||
pub fn id(this: &AudioTrack) -> ::alloc::string::String;
|
||||
# [wasm_bindgen (structural , method , getter , js_class = "AudioTrack" , js_name = kind)]
|
||||
#[doc = "Getter for the `kind` field of this object."]
|
||||
#[doc = ""]
|
||||
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AudioTrack/kind)"]
|
||||
#[doc = ""]
|
||||
#[doc = "*This API requires the following crate features to be activated: `AudioTrack`*"]
|
||||
pub fn kind(this: &AudioTrack) -> String;
|
||||
pub fn kind(this: &AudioTrack) -> ::alloc::string::String;
|
||||
# [wasm_bindgen (structural , method , getter , js_class = "AudioTrack" , js_name = label)]
|
||||
#[doc = "Getter for the `label` field of this object."]
|
||||
#[doc = ""]
|
||||
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AudioTrack/label)"]
|
||||
#[doc = ""]
|
||||
#[doc = "*This API requires the following crate features to be activated: `AudioTrack`*"]
|
||||
pub fn label(this: &AudioTrack) -> String;
|
||||
pub fn label(this: &AudioTrack) -> ::alloc::string::String;
|
||||
# [wasm_bindgen (structural , method , getter , js_class = "AudioTrack" , js_name = language)]
|
||||
#[doc = "Getter for the `language` field of this object."]
|
||||
#[doc = ""]
|
||||
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AudioTrack/language)"]
|
||||
#[doc = ""]
|
||||
#[doc = "*This API requires the following crate features to be activated: `AudioTrack`*"]
|
||||
pub fn language(this: &AudioTrack) -> String;
|
||||
pub fn language(this: &AudioTrack) -> ::alloc::string::String;
|
||||
# [wasm_bindgen (structural , method , getter , js_class = "AudioTrack" , js_name = enabled)]
|
||||
#[doc = "Getter for the `enabled` field of this object."]
|
||||
#[doc = ""]
|
||||
|
@ -14,7 +14,9 @@ extern "C" {
|
||||
#[doc = ""]
|
||||
#[doc = "*This API requires the following crate features to be activated: `AuthenticationExtensionsClientInputs`*"]
|
||||
#[wasm_bindgen(method, getter = "appid")]
|
||||
pub fn get_appid(this: &AuthenticationExtensionsClientInputs) -> Option<String>;
|
||||
pub fn get_appid(
|
||||
this: &AuthenticationExtensionsClientInputs,
|
||||
) -> Option<::alloc::string::String>;
|
||||
#[doc = "Change the `appid` field of this object."]
|
||||
#[doc = ""]
|
||||
#[doc = "*This API requires the following crate features to be activated: `AuthenticationExtensionsClientInputs`*"]
|
||||
@ -24,7 +26,9 @@ extern "C" {
|
||||
#[doc = ""]
|
||||
#[doc = "*This API requires the following crate features to be activated: `AuthenticationExtensionsClientInputs`*"]
|
||||
#[wasm_bindgen(method, getter = "appidExclude")]
|
||||
pub fn get_appid_exclude(this: &AuthenticationExtensionsClientInputs) -> Option<String>;
|
||||
pub fn get_appid_exclude(
|
||||
this: &AuthenticationExtensionsClientInputs,
|
||||
) -> Option<::alloc::string::String>;
|
||||
#[doc = "Change the `appidExclude` field of this object."]
|
||||
#[doc = ""]
|
||||
#[doc = "*This API requires the following crate features to be activated: `AuthenticationExtensionsClientInputs`*"]
|
||||
|
@ -22,7 +22,9 @@ extern "C" {
|
||||
#[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
|
||||
#[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
|
||||
#[wasm_bindgen(method, getter = "attestation")]
|
||||
pub fn get_attestation(this: &AuthenticationExtensionsDevicePublicKeyInputs) -> Option<String>;
|
||||
pub fn get_attestation(
|
||||
this: &AuthenticationExtensionsDevicePublicKeyInputs,
|
||||
) -> Option<::alloc::string::String>;
|
||||
#[cfg(web_sys_unstable_apis)]
|
||||
#[doc = "Change the `attestation` field of this object."]
|
||||
#[doc = ""]
|
||||
|
@ -24,7 +24,9 @@ extern "C" {
|
||||
#[doc = ""]
|
||||
#[doc = "*This API requires the following crate features to be activated: `AuthenticationExtensionsLargeBlobInputs`*"]
|
||||
#[wasm_bindgen(method, getter = "support")]
|
||||
pub fn get_support(this: &AuthenticationExtensionsLargeBlobInputs) -> Option<String>;
|
||||
pub fn get_support(
|
||||
this: &AuthenticationExtensionsLargeBlobInputs,
|
||||
) -> Option<::alloc::string::String>;
|
||||
#[doc = "Change the `support` field of this object."]
|
||||
#[doc = ""]
|
||||
#[doc = "*This API requires the following crate features to be activated: `AuthenticationExtensionsLargeBlobInputs`*"]
|
||||
|
@ -22,7 +22,9 @@ extern "C" {
|
||||
#[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
|
||||
#[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
|
||||
#[wasm_bindgen(method, getter = "authenticatorAttachment")]
|
||||
pub fn get_authenticator_attachment(this: &AuthenticationResponseJson) -> Option<String>;
|
||||
pub fn get_authenticator_attachment(
|
||||
this: &AuthenticationResponseJson,
|
||||
) -> Option<::alloc::string::String>;
|
||||
#[cfg(web_sys_unstable_apis)]
|
||||
#[doc = "Change the `authenticatorAttachment` field of this object."]
|
||||
#[doc = ""]
|
||||
@ -65,7 +67,7 @@ extern "C" {
|
||||
#[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
|
||||
#[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
|
||||
#[wasm_bindgen(method, getter = "id")]
|
||||
pub fn get_id(this: &AuthenticationResponseJson) -> String;
|
||||
pub fn get_id(this: &AuthenticationResponseJson) -> ::alloc::string::String;
|
||||
#[cfg(web_sys_unstable_apis)]
|
||||
#[doc = "Change the `id` field of this object."]
|
||||
#[doc = ""]
|
||||
@ -83,7 +85,7 @@ extern "C" {
|
||||
#[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
|
||||
#[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
|
||||
#[wasm_bindgen(method, getter = "rawId")]
|
||||
pub fn get_raw_id(this: &AuthenticationResponseJson) -> String;
|
||||
pub fn get_raw_id(this: &AuthenticationResponseJson) -> ::alloc::string::String;
|
||||
#[cfg(web_sys_unstable_apis)]
|
||||
#[doc = "Change the `rawId` field of this object."]
|
||||
#[doc = ""]
|
||||
@ -124,7 +126,7 @@ extern "C" {
|
||||
#[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
|
||||
#[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
|
||||
#[wasm_bindgen(method, getter = "type")]
|
||||
pub fn get_type(this: &AuthenticationResponseJson) -> String;
|
||||
pub fn get_type(this: &AuthenticationResponseJson) -> ::alloc::string::String;
|
||||
#[cfg(web_sys_unstable_apis)]
|
||||
#[doc = "Change the `type` field of this object."]
|
||||
#[doc = ""]
|
||||
|
@ -22,7 +22,9 @@ extern "C" {
|
||||
#[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
|
||||
#[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
|
||||
#[wasm_bindgen(method, getter = "attestationObject")]
|
||||
pub fn get_attestation_object(this: &AuthenticatorAssertionResponseJson) -> Option<String>;
|
||||
pub fn get_attestation_object(
|
||||
this: &AuthenticatorAssertionResponseJson,
|
||||
) -> Option<::alloc::string::String>;
|
||||
#[cfg(web_sys_unstable_apis)]
|
||||
#[doc = "Change the `attestationObject` field of this object."]
|
||||
#[doc = ""]
|
||||
@ -40,7 +42,9 @@ extern "C" {
|
||||
#[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
|
||||
#[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
|
||||
#[wasm_bindgen(method, getter = "authenticatorData")]
|
||||
pub fn get_authenticator_data(this: &AuthenticatorAssertionResponseJson) -> String;
|
||||
pub fn get_authenticator_data(
|
||||
this: &AuthenticatorAssertionResponseJson,
|
||||
) -> ::alloc::string::String;
|
||||
#[cfg(web_sys_unstable_apis)]
|
||||
#[doc = "Change the `authenticatorData` field of this object."]
|
||||
#[doc = ""]
|
||||
@ -58,7 +62,9 @@ extern "C" {
|
||||
#[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
|
||||
#[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
|
||||
#[wasm_bindgen(method, getter = "clientDataJSON")]
|
||||
pub fn get_client_data_json(this: &AuthenticatorAssertionResponseJson) -> String;
|
||||
pub fn get_client_data_json(
|
||||
this: &AuthenticatorAssertionResponseJson,
|
||||
) -> ::alloc::string::String;
|
||||
#[cfg(web_sys_unstable_apis)]
|
||||
#[doc = "Change the `clientDataJSON` field of this object."]
|
||||
#[doc = ""]
|
||||
@ -76,7 +82,7 @@ extern "C" {
|
||||
#[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
|
||||
#[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
|
||||
#[wasm_bindgen(method, getter = "signature")]
|
||||
pub fn get_signature(this: &AuthenticatorAssertionResponseJson) -> String;
|
||||
pub fn get_signature(this: &AuthenticatorAssertionResponseJson) -> ::alloc::string::String;
|
||||
#[cfg(web_sys_unstable_apis)]
|
||||
#[doc = "Change the `signature` field of this object."]
|
||||
#[doc = ""]
|
||||
@ -94,7 +100,9 @@ extern "C" {
|
||||
#[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
|
||||
#[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
|
||||
#[wasm_bindgen(method, getter = "userHandle")]
|
||||
pub fn get_user_handle(this: &AuthenticatorAssertionResponseJson) -> Option<String>;
|
||||
pub fn get_user_handle(
|
||||
this: &AuthenticatorAssertionResponseJson,
|
||||
) -> Option<::alloc::string::String>;
|
||||
#[cfg(web_sys_unstable_apis)]
|
||||
#[doc = "Change the `userHandle` field of this object."]
|
||||
#[doc = ""]
|
||||
|
@ -22,7 +22,9 @@ extern "C" {
|
||||
#[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
|
||||
#[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
|
||||
#[wasm_bindgen(method, getter = "attestationObject")]
|
||||
pub fn get_attestation_object(this: &AuthenticatorAttestationResponseJson) -> String;
|
||||
pub fn get_attestation_object(
|
||||
this: &AuthenticatorAttestationResponseJson,
|
||||
) -> ::alloc::string::String;
|
||||
#[cfg(web_sys_unstable_apis)]
|
||||
#[doc = "Change the `attestationObject` field of this object."]
|
||||
#[doc = ""]
|
||||
@ -40,7 +42,9 @@ extern "C" {
|
||||
#[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
|
||||
#[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
|
||||
#[wasm_bindgen(method, getter = "authenticatorData")]
|
||||
pub fn get_authenticator_data(this: &AuthenticatorAttestationResponseJson) -> String;
|
||||
pub fn get_authenticator_data(
|
||||
this: &AuthenticatorAttestationResponseJson,
|
||||
) -> ::alloc::string::String;
|
||||
#[cfg(web_sys_unstable_apis)]
|
||||
#[doc = "Change the `authenticatorData` field of this object."]
|
||||
#[doc = ""]
|
||||
@ -58,7 +62,9 @@ extern "C" {
|
||||
#[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
|
||||
#[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
|
||||
#[wasm_bindgen(method, getter = "clientDataJSON")]
|
||||
pub fn get_client_data_json(this: &AuthenticatorAttestationResponseJson) -> String;
|
||||
pub fn get_client_data_json(
|
||||
this: &AuthenticatorAttestationResponseJson,
|
||||
) -> ::alloc::string::String;
|
||||
#[cfg(web_sys_unstable_apis)]
|
||||
#[doc = "Change the `clientDataJSON` field of this object."]
|
||||
#[doc = ""]
|
||||
@ -76,7 +82,9 @@ extern "C" {
|
||||
#[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
|
||||
#[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
|
||||
#[wasm_bindgen(method, getter = "publicKey")]
|
||||
pub fn get_public_key(this: &AuthenticatorAttestationResponseJson) -> Option<String>;
|
||||
pub fn get_public_key(
|
||||
this: &AuthenticatorAttestationResponseJson,
|
||||
) -> Option<::alloc::string::String>;
|
||||
#[cfg(web_sys_unstable_apis)]
|
||||
#[doc = "Change the `publicKey` field of this object."]
|
||||
#[doc = ""]
|
||||
|
@ -41,7 +41,9 @@ extern "C" {
|
||||
#[doc = ""]
|
||||
#[doc = "*This API requires the following crate features to be activated: `AuthenticatorSelectionCriteria`*"]
|
||||
#[wasm_bindgen(method, getter = "residentKey")]
|
||||
pub fn get_resident_key(this: &AuthenticatorSelectionCriteria) -> Option<String>;
|
||||
pub fn get_resident_key(
|
||||
this: &AuthenticatorSelectionCriteria,
|
||||
) -> Option<::alloc::string::String>;
|
||||
#[doc = "Change the `residentKey` field of this object."]
|
||||
#[doc = ""]
|
||||
#[doc = "*This API requires the following crate features to be activated: `AuthenticatorSelectionCriteria`*"]
|
||||
|
@ -14,7 +14,7 @@ extern "C" {
|
||||
#[doc = ""]
|
||||
#[doc = "*This API requires the following crate features to be activated: `AutocompleteInfo`*"]
|
||||
#[wasm_bindgen(method, getter = "addressType")]
|
||||
pub fn get_address_type(this: &AutocompleteInfo) -> Option<String>;
|
||||
pub fn get_address_type(this: &AutocompleteInfo) -> Option<::alloc::string::String>;
|
||||
#[doc = "Change the `addressType` field of this object."]
|
||||
#[doc = ""]
|
||||
#[doc = "*This API requires the following crate features to be activated: `AutocompleteInfo`*"]
|
||||
@ -24,7 +24,7 @@ extern "C" {
|
||||
#[doc = ""]
|
||||
#[doc = "*This API requires the following crate features to be activated: `AutocompleteInfo`*"]
|
||||
#[wasm_bindgen(method, getter = "contactType")]
|
||||
pub fn get_contact_type(this: &AutocompleteInfo) -> Option<String>;
|
||||
pub fn get_contact_type(this: &AutocompleteInfo) -> Option<::alloc::string::String>;
|
||||
#[doc = "Change the `contactType` field of this object."]
|
||||
#[doc = ""]
|
||||
#[doc = "*This API requires the following crate features to be activated: `AutocompleteInfo`*"]
|
||||
@ -34,7 +34,7 @@ extern "C" {
|
||||
#[doc = ""]
|
||||
#[doc = "*This API requires the following crate features to be activated: `AutocompleteInfo`*"]
|
||||
#[wasm_bindgen(method, getter = "fieldName")]
|
||||
pub fn get_field_name(this: &AutocompleteInfo) -> Option<String>;
|
||||
pub fn get_field_name(this: &AutocompleteInfo) -> Option<::alloc::string::String>;
|
||||
#[doc = "Change the `fieldName` field of this object."]
|
||||
#[doc = ""]
|
||||
#[doc = "*This API requires the following crate features to be activated: `AutocompleteInfo`*"]
|
||||
@ -44,7 +44,7 @@ extern "C" {
|
||||
#[doc = ""]
|
||||
#[doc = "*This API requires the following crate features to be activated: `AutocompleteInfo`*"]
|
||||
#[wasm_bindgen(method, getter = "section")]
|
||||
pub fn get_section(this: &AutocompleteInfo) -> Option<String>;
|
||||
pub fn get_section(this: &AutocompleteInfo) -> Option<::alloc::string::String>;
|
||||
#[doc = "Change the `section` field of this object."]
|
||||
#[doc = ""]
|
||||
#[doc = "*This API requires the following crate features to be activated: `AutocompleteInfo`*"]
|
||||
|
@ -26,7 +26,7 @@ extern "C" {
|
||||
#[doc = ""]
|
||||
#[doc = "*This API requires the following crate features to be activated: `BaseComputedKeyframe`*"]
|
||||
#[wasm_bindgen(method, getter = "easing")]
|
||||
pub fn get_easing(this: &BaseComputedKeyframe) -> Option<String>;
|
||||
pub fn get_easing(this: &BaseComputedKeyframe) -> Option<::alloc::string::String>;
|
||||
#[doc = "Change the `easing` field of this object."]
|
||||
#[doc = ""]
|
||||
#[doc = "*This API requires the following crate features to be activated: `BaseComputedKeyframe`*"]
|
||||
|
@ -26,7 +26,7 @@ extern "C" {
|
||||
#[doc = ""]
|
||||
#[doc = "*This API requires the following crate features to be activated: `BaseKeyframe`*"]
|
||||
#[wasm_bindgen(method, getter = "easing")]
|
||||
pub fn get_easing(this: &BaseKeyframe) -> Option<String>;
|
||||
pub fn get_easing(this: &BaseKeyframe) -> Option<::alloc::string::String>;
|
||||
#[doc = "Change the `easing` field of this object."]
|
||||
#[doc = ""]
|
||||
#[doc = "*This API requires the following crate features to be activated: `BaseKeyframe`*"]
|
||||
|
@ -26,7 +26,7 @@ extern "C" {
|
||||
#[doc = ""]
|
||||
#[doc = "*This API requires the following crate features to be activated: `BasicCardResponse`*"]
|
||||
#[wasm_bindgen(method, getter = "cardNumber")]
|
||||
pub fn get_card_number(this: &BasicCardResponse) -> String;
|
||||
pub fn get_card_number(this: &BasicCardResponse) -> ::alloc::string::String;
|
||||
#[doc = "Change the `cardNumber` field of this object."]
|
||||
#[doc = ""]
|
||||
#[doc = "*This API requires the following crate features to be activated: `BasicCardResponse`*"]
|
||||
@ -36,7 +36,7 @@ extern "C" {
|
||||
#[doc = ""]
|
||||
#[doc = "*This API requires the following crate features to be activated: `BasicCardResponse`*"]
|
||||
#[wasm_bindgen(method, getter = "cardSecurityCode")]
|
||||
pub fn get_card_security_code(this: &BasicCardResponse) -> Option<String>;
|
||||
pub fn get_card_security_code(this: &BasicCardResponse) -> Option<::alloc::string::String>;
|
||||
#[doc = "Change the `cardSecurityCode` field of this object."]
|
||||
#[doc = ""]
|
||||
#[doc = "*This API requires the following crate features to be activated: `BasicCardResponse`*"]
|
||||
@ -46,7 +46,7 @@ extern "C" {
|
||||
#[doc = ""]
|
||||
#[doc = "*This API requires the following crate features to be activated: `BasicCardResponse`*"]
|
||||
#[wasm_bindgen(method, getter = "cardholderName")]
|
||||
pub fn get_cardholder_name(this: &BasicCardResponse) -> Option<String>;
|
||||
pub fn get_cardholder_name(this: &BasicCardResponse) -> Option<::alloc::string::String>;
|
||||
#[doc = "Change the `cardholderName` field of this object."]
|
||||
#[doc = ""]
|
||||
#[doc = "*This API requires the following crate features to be activated: `BasicCardResponse`*"]
|
||||
@ -56,7 +56,7 @@ extern "C" {
|
||||
#[doc = ""]
|
||||
#[doc = "*This API requires the following crate features to be activated: `BasicCardResponse`*"]
|
||||
#[wasm_bindgen(method, getter = "expiryMonth")]
|
||||
pub fn get_expiry_month(this: &BasicCardResponse) -> Option<String>;
|
||||
pub fn get_expiry_month(this: &BasicCardResponse) -> Option<::alloc::string::String>;
|
||||
#[doc = "Change the `expiryMonth` field of this object."]
|
||||
#[doc = ""]
|
||||
#[doc = "*This API requires the following crate features to be activated: `BasicCardResponse`*"]
|
||||
@ -66,7 +66,7 @@ extern "C" {
|
||||
#[doc = ""]
|
||||
#[doc = "*This API requires the following crate features to be activated: `BasicCardResponse`*"]
|
||||
#[wasm_bindgen(method, getter = "expiryYear")]
|
||||
pub fn get_expiry_year(this: &BasicCardResponse) -> Option<String>;
|
||||
pub fn get_expiry_year(this: &BasicCardResponse) -> Option<::alloc::string::String>;
|
||||
#[doc = "Change the `expiryYear` field of this object."]
|
||||
#[doc = ""]
|
||||
#[doc = "*This API requires the following crate features to be activated: `BasicCardResponse`*"]
|
||||
|
@ -18,7 +18,7 @@ extern "C" {
|
||||
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/BeforeUnloadEvent/returnValue)"]
|
||||
#[doc = ""]
|
||||
#[doc = "*This API requires the following crate features to be activated: `BeforeUnloadEvent`*"]
|
||||
pub fn return_value(this: &BeforeUnloadEvent) -> String;
|
||||
pub fn return_value(this: &BeforeUnloadEvent) -> ::alloc::string::String;
|
||||
# [wasm_bindgen (structural , method , setter , js_class = "BeforeUnloadEvent" , js_name = returnValue)]
|
||||
#[doc = "Setter for the `returnValue` field of this object."]
|
||||
#[doc = ""]
|
||||
|
@ -25,7 +25,7 @@ extern "C" {
|
||||
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Blob/type)"]
|
||||
#[doc = ""]
|
||||
#[doc = "*This API requires the following crate features to be activated: `Blob`*"]
|
||||
pub fn type_(this: &Blob) -> String;
|
||||
pub fn type_(this: &Blob) -> ::alloc::string::String;
|
||||
#[wasm_bindgen(catch, constructor, js_class = "Blob")]
|
||||
#[doc = "The `new Blob(..)` constructor, creating a new instance of `Blob`."]
|
||||
#[doc = ""]
|
||||
|
@ -26,7 +26,7 @@ extern "C" {
|
||||
#[doc = ""]
|
||||
#[doc = "*This API requires the following crate features to be activated: `BlobPropertyBag`*"]
|
||||
#[wasm_bindgen(method, getter = "type")]
|
||||
pub fn get_type(this: &BlobPropertyBag) -> Option<String>;
|
||||
pub fn get_type(this: &BlobPropertyBag) -> Option<::alloc::string::String>;
|
||||
#[doc = "Change the `type` field of this object."]
|
||||
#[doc = ""]
|
||||
#[doc = "*This API requires the following crate features to be activated: `BlobPropertyBag`*"]
|
||||
|
@ -49,7 +49,7 @@ extern "C" {
|
||||
#[doc = ""]
|
||||
#[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
|
||||
#[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
|
||||
pub fn name(this: &BluetoothAdvertisingEvent) -> Option<String>;
|
||||
pub fn name(this: &BluetoothAdvertisingEvent) -> Option<::alloc::string::String>;
|
||||
#[cfg(web_sys_unstable_apis)]
|
||||
# [wasm_bindgen (structural , method , getter , js_class = "BluetoothAdvertisingEvent" , js_name = appearance)]
|
||||
#[doc = "Getter for the `appearance` field of this object."]
|
||||
|
@ -139,7 +139,7 @@ extern "C" {
|
||||
#[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
|
||||
#[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
|
||||
#[wasm_bindgen(method, getter = "name")]
|
||||
pub fn get_name(this: &BluetoothAdvertisingEventInit) -> Option<String>;
|
||||
pub fn get_name(this: &BluetoothAdvertisingEventInit) -> Option<::alloc::string::String>;
|
||||
#[cfg(web_sys_unstable_apis)]
|
||||
#[doc = "Change the `name` field of this object."]
|
||||
#[doc = ""]
|
||||
|
@ -26,7 +26,7 @@ extern "C" {
|
||||
#[doc = ""]
|
||||
#[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
|
||||
#[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
|
||||
pub fn id(this: &BluetoothDevice) -> String;
|
||||
pub fn id(this: &BluetoothDevice) -> ::alloc::string::String;
|
||||
#[cfg(web_sys_unstable_apis)]
|
||||
# [wasm_bindgen (structural , method , getter , js_class = "BluetoothDevice" , js_name = name)]
|
||||
#[doc = "Getter for the `name` field of this object."]
|
||||
@ -37,7 +37,7 @@ extern "C" {
|
||||
#[doc = ""]
|
||||
#[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
|
||||
#[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
|
||||
pub fn name(this: &BluetoothDevice) -> Option<String>;
|
||||
pub fn name(this: &BluetoothDevice) -> Option<::alloc::string::String>;
|
||||
#[cfg(web_sys_unstable_apis)]
|
||||
#[cfg(feature = "BluetoothRemoteGattServer")]
|
||||
# [wasm_bindgen (structural , method , getter , js_class = "BluetoothDevice" , js_name = gatt)]
|
||||
|
@ -40,7 +40,7 @@ extern "C" {
|
||||
#[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
|
||||
#[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
|
||||
#[wasm_bindgen(method, getter = "name")]
|
||||
pub fn get_name(this: &BluetoothLeScanFilterInit) -> Option<String>;
|
||||
pub fn get_name(this: &BluetoothLeScanFilterInit) -> Option<::alloc::string::String>;
|
||||
#[cfg(web_sys_unstable_apis)]
|
||||
#[doc = "Change the `name` field of this object."]
|
||||
#[doc = ""]
|
||||
@ -58,7 +58,7 @@ extern "C" {
|
||||
#[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
|
||||
#[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
|
||||
#[wasm_bindgen(method, getter = "namePrefix")]
|
||||
pub fn get_name_prefix(this: &BluetoothLeScanFilterInit) -> Option<String>;
|
||||
pub fn get_name_prefix(this: &BluetoothLeScanFilterInit) -> Option<::alloc::string::String>;
|
||||
#[cfg(web_sys_unstable_apis)]
|
||||
#[doc = "Change the `namePrefix` field of this object."]
|
||||
#[doc = ""]
|
||||
|
@ -60,7 +60,7 @@ extern "C" {
|
||||
#[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
|
||||
#[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
|
||||
#[wasm_bindgen(method, getter = "deviceId")]
|
||||
pub fn get_device_id(this: &BluetoothPermissionDescriptor) -> Option<String>;
|
||||
pub fn get_device_id(this: &BluetoothPermissionDescriptor) -> Option<::alloc::string::String>;
|
||||
#[cfg(web_sys_unstable_apis)]
|
||||
#[doc = "Change the `deviceId` field of this object."]
|
||||
#[doc = ""]
|
||||
|
@ -38,7 +38,7 @@ extern "C" {
|
||||
#[doc = ""]
|
||||
#[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
|
||||
#[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
|
||||
pub fn uuid(this: &BluetoothRemoteGattCharacteristic) -> String;
|
||||
pub fn uuid(this: &BluetoothRemoteGattCharacteristic) -> ::alloc::string::String;
|
||||
#[cfg(web_sys_unstable_apis)]
|
||||
#[cfg(feature = "BluetoothCharacteristicProperties")]
|
||||
# [wasm_bindgen (structural , method , getter , js_class = "BluetoothRemoteGATTCharacteristic" , js_name = properties)]
|
||||
|
@ -40,7 +40,7 @@ extern "C" {
|
||||
#[doc = ""]
|
||||
#[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
|
||||
#[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
|
||||
pub fn uuid(this: &BluetoothRemoteGattDescriptor) -> String;
|
||||
pub fn uuid(this: &BluetoothRemoteGattDescriptor) -> ::alloc::string::String;
|
||||
#[cfg(web_sys_unstable_apis)]
|
||||
# [wasm_bindgen (structural , method , getter , js_class = "BluetoothRemoteGATTDescriptor" , js_name = value)]
|
||||
#[doc = "Getter for the `value` field of this object."]
|
||||
|
@ -38,7 +38,7 @@ extern "C" {
|
||||
#[doc = ""]
|
||||
#[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
|
||||
#[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
|
||||
pub fn uuid(this: &BluetoothRemoteGattService) -> String;
|
||||
pub fn uuid(this: &BluetoothRemoteGattService) -> ::alloc::string::String;
|
||||
#[cfg(web_sys_unstable_apis)]
|
||||
# [wasm_bindgen (structural , method , getter , js_class = "BluetoothRemoteGATTService" , js_name = isPrimary)]
|
||||
#[doc = "Getter for the `isPrimary` field of this object."]
|
||||
|
@ -26,7 +26,7 @@ extern "C" {
|
||||
#[doc = ""]
|
||||
#[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
|
||||
#[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
|
||||
pub fn canonical_uuid(alias: u32) -> String;
|
||||
pub fn canonical_uuid(alias: u32) -> ::alloc::string::String;
|
||||
#[cfg(web_sys_unstable_apis)]
|
||||
# [wasm_bindgen (static_method_of = BluetoothUuid , js_class = "BluetoothUUID" , js_name = getCharacteristic)]
|
||||
#[doc = "The `getCharacteristic()` method."]
|
||||
@ -37,7 +37,7 @@ extern "C" {
|
||||
#[doc = ""]
|
||||
#[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
|
||||
#[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
|
||||
pub fn get_characteristic_with_str(name: &str) -> String;
|
||||
pub fn get_characteristic_with_str(name: &str) -> ::alloc::string::String;
|
||||
#[cfg(web_sys_unstable_apis)]
|
||||
# [wasm_bindgen (static_method_of = BluetoothUuid , js_class = "BluetoothUUID" , js_name = getCharacteristic)]
|
||||
#[doc = "The `getCharacteristic()` method."]
|
||||
@ -48,7 +48,7 @@ extern "C" {
|
||||
#[doc = ""]
|
||||
#[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
|
||||
#[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
|
||||
pub fn get_characteristic_with_u32(name: u32) -> String;
|
||||
pub fn get_characteristic_with_u32(name: u32) -> ::alloc::string::String;
|
||||
#[cfg(web_sys_unstable_apis)]
|
||||
# [wasm_bindgen (static_method_of = BluetoothUuid , js_class = "BluetoothUUID" , js_name = getDescriptor)]
|
||||
#[doc = "The `getDescriptor()` method."]
|
||||
@ -59,7 +59,7 @@ extern "C" {
|
||||
#[doc = ""]
|
||||
#[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
|
||||
#[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
|
||||
pub fn get_descriptor_with_str(name: &str) -> String;
|
||||
pub fn get_descriptor_with_str(name: &str) -> ::alloc::string::String;
|
||||
#[cfg(web_sys_unstable_apis)]
|
||||
# [wasm_bindgen (static_method_of = BluetoothUuid , js_class = "BluetoothUUID" , js_name = getDescriptor)]
|
||||
#[doc = "The `getDescriptor()` method."]
|
||||
@ -70,7 +70,7 @@ extern "C" {
|
||||
#[doc = ""]
|
||||
#[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
|
||||
#[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
|
||||
pub fn get_descriptor_with_u32(name: u32) -> String;
|
||||
pub fn get_descriptor_with_u32(name: u32) -> ::alloc::string::String;
|
||||
#[cfg(web_sys_unstable_apis)]
|
||||
# [wasm_bindgen (static_method_of = BluetoothUuid , js_class = "BluetoothUUID" , js_name = getService)]
|
||||
#[doc = "The `getService()` method."]
|
||||
@ -81,7 +81,7 @@ extern "C" {
|
||||
#[doc = ""]
|
||||
#[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
|
||||
#[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
|
||||
pub fn get_service_with_str(name: &str) -> String;
|
||||
pub fn get_service_with_str(name: &str) -> ::alloc::string::String;
|
||||
#[cfg(web_sys_unstable_apis)]
|
||||
# [wasm_bindgen (static_method_of = BluetoothUuid , js_class = "BluetoothUUID" , js_name = getService)]
|
||||
#[doc = "The `getService()` method."]
|
||||
@ -92,5 +92,5 @@ extern "C" {
|
||||
#[doc = ""]
|
||||
#[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
|
||||
#[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
|
||||
pub fn get_service_with_u32(name: u32) -> String;
|
||||
pub fn get_service_with_u32(name: u32) -> ::alloc::string::String;
|
||||
}
|
||||
|
@ -18,7 +18,7 @@ extern "C" {
|
||||
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/BroadcastChannel/name)"]
|
||||
#[doc = ""]
|
||||
#[doc = "*This API requires the following crate features to be activated: `BroadcastChannel`*"]
|
||||
pub fn name(this: &BroadcastChannel) -> String;
|
||||
pub fn name(this: &BroadcastChannel) -> ::alloc::string::String;
|
||||
# [wasm_bindgen (structural , method , getter , js_class = "BroadcastChannel" , js_name = onmessage)]
|
||||
#[doc = "Getter for the `onmessage` field of this object."]
|
||||
#[doc = ""]
|
||||
|
@ -14,7 +14,7 @@ extern "C" {
|
||||
#[doc = ""]
|
||||
#[doc = "*This API requires the following crate features to be activated: `BrowserElementDownloadOptions`*"]
|
||||
#[wasm_bindgen(method, getter = "filename")]
|
||||
pub fn get_filename(this: &BrowserElementDownloadOptions) -> Option<String>;
|
||||
pub fn get_filename(this: &BrowserElementDownloadOptions) -> Option<::alloc::string::String>;
|
||||
#[doc = "Change the `filename` field of this object."]
|
||||
#[doc = ""]
|
||||
#[doc = "*This API requires the following crate features to be activated: `BrowserElementDownloadOptions`*"]
|
||||
@ -24,7 +24,7 @@ extern "C" {
|
||||
#[doc = ""]
|
||||
#[doc = "*This API requires the following crate features to be activated: `BrowserElementDownloadOptions`*"]
|
||||
#[wasm_bindgen(method, getter = "referrer")]
|
||||
pub fn get_referrer(this: &BrowserElementDownloadOptions) -> Option<String>;
|
||||
pub fn get_referrer(this: &BrowserElementDownloadOptions) -> Option<::alloc::string::String>;
|
||||
#[doc = "Change the `referrer` field of this object."]
|
||||
#[doc = ""]
|
||||
#[doc = "*This API requires the following crate features to be activated: `BrowserElementDownloadOptions`*"]
|
||||
|
@ -14,7 +14,8 @@ extern "C" {
|
||||
#[doc = ""]
|
||||
#[doc = "*This API requires the following crate features to be activated: `BrowserElementExecuteScriptOptions`*"]
|
||||
#[wasm_bindgen(method, getter = "origin")]
|
||||
pub fn get_origin(this: &BrowserElementExecuteScriptOptions) -> Option<String>;
|
||||
pub fn get_origin(this: &BrowserElementExecuteScriptOptions)
|
||||
-> Option<::alloc::string::String>;
|
||||
#[doc = "Change the `origin` field of this object."]
|
||||
#[doc = ""]
|
||||
#[doc = "*This API requires the following crate features to be activated: `BrowserElementExecuteScriptOptions`*"]
|
||||
@ -24,7 +25,7 @@ extern "C" {
|
||||
#[doc = ""]
|
||||
#[doc = "*This API requires the following crate features to be activated: `BrowserElementExecuteScriptOptions`*"]
|
||||
#[wasm_bindgen(method, getter = "url")]
|
||||
pub fn get_url(this: &BrowserElementExecuteScriptOptions) -> Option<String>;
|
||||
pub fn get_url(this: &BrowserElementExecuteScriptOptions) -> Option<::alloc::string::String>;
|
||||
#[doc = "Change the `url` field of this object."]
|
||||
#[doc = ""]
|
||||
#[doc = "*This API requires the following crate features to be activated: `BrowserElementExecuteScriptOptions`*"]
|
||||
|
@ -50,7 +50,7 @@ extern "C" {
|
||||
#[doc = ""]
|
||||
#[doc = "*This API requires the following crate features to be activated: `CacheBatchOperation`*"]
|
||||
#[wasm_bindgen(method, getter = "type")]
|
||||
pub fn get_type(this: &CacheBatchOperation) -> Option<String>;
|
||||
pub fn get_type(this: &CacheBatchOperation) -> Option<::alloc::string::String>;
|
||||
#[doc = "Change the `type` field of this object."]
|
||||
#[doc = ""]
|
||||
#[doc = "*This API requires the following crate features to be activated: `CacheBatchOperation`*"]
|
||||
|
@ -14,7 +14,7 @@ extern "C" {
|
||||
#[doc = ""]
|
||||
#[doc = "*This API requires the following crate features to be activated: `CacheQueryOptions`*"]
|
||||
#[wasm_bindgen(method, getter = "cacheName")]
|
||||
pub fn get_cache_name(this: &CacheQueryOptions) -> Option<String>;
|
||||
pub fn get_cache_name(this: &CacheQueryOptions) -> Option<::alloc::string::String>;
|
||||
#[doc = "Change the `cacheName` field of this object."]
|
||||
#[doc = ""]
|
||||
#[doc = "*This API requires the following crate features to be activated: `CacheQueryOptions`*"]
|
||||
|
@ -40,7 +40,9 @@ extern "C" {
|
||||
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/globalCompositeOperation)"]
|
||||
#[doc = ""]
|
||||
#[doc = "*This API requires the following crate features to be activated: `CanvasRenderingContext2d`*"]
|
||||
pub fn global_composite_operation(this: &CanvasRenderingContext2d) -> Result<String, JsValue>;
|
||||
pub fn global_composite_operation(
|
||||
this: &CanvasRenderingContext2d,
|
||||
) -> Result<::alloc::string::String, JsValue>;
|
||||
# [wasm_bindgen (structural , catch , method , setter , js_class = "CanvasRenderingContext2D" , js_name = globalCompositeOperation)]
|
||||
#[doc = "Setter for the `globalCompositeOperation` field of this object."]
|
||||
#[doc = ""]
|
||||
@ -136,7 +138,7 @@ extern "C" {
|
||||
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/filter)"]
|
||||
#[doc = ""]
|
||||
#[doc = "*This API requires the following crate features to be activated: `CanvasRenderingContext2d`*"]
|
||||
pub fn filter(this: &CanvasRenderingContext2d) -> String;
|
||||
pub fn filter(this: &CanvasRenderingContext2d) -> ::alloc::string::String;
|
||||
# [wasm_bindgen (structural , method , setter , js_class = "CanvasRenderingContext2D" , js_name = filter)]
|
||||
#[doc = "Setter for the `filter` field of this object."]
|
||||
#[doc = ""]
|
||||
@ -178,7 +180,7 @@ extern "C" {
|
||||
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/lineCap)"]
|
||||
#[doc = ""]
|
||||
#[doc = "*This API requires the following crate features to be activated: `CanvasRenderingContext2d`*"]
|
||||
pub fn line_cap(this: &CanvasRenderingContext2d) -> String;
|
||||
pub fn line_cap(this: &CanvasRenderingContext2d) -> ::alloc::string::String;
|
||||
# [wasm_bindgen (structural , method , setter , js_class = "CanvasRenderingContext2D" , js_name = lineCap)]
|
||||
#[doc = "Setter for the `lineCap` field of this object."]
|
||||
#[doc = ""]
|
||||
@ -192,7 +194,7 @@ extern "C" {
|
||||
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/lineJoin)"]
|
||||
#[doc = ""]
|
||||
#[doc = "*This API requires the following crate features to be activated: `CanvasRenderingContext2d`*"]
|
||||
pub fn line_join(this: &CanvasRenderingContext2d) -> String;
|
||||
pub fn line_join(this: &CanvasRenderingContext2d) -> ::alloc::string::String;
|
||||
# [wasm_bindgen (structural , method , setter , js_class = "CanvasRenderingContext2D" , js_name = lineJoin)]
|
||||
#[doc = "Setter for the `lineJoin` field of this object."]
|
||||
#[doc = ""]
|
||||
@ -276,7 +278,7 @@ extern "C" {
|
||||
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/shadowColor)"]
|
||||
#[doc = ""]
|
||||
#[doc = "*This API requires the following crate features to be activated: `CanvasRenderingContext2d`*"]
|
||||
pub fn shadow_color(this: &CanvasRenderingContext2d) -> String;
|
||||
pub fn shadow_color(this: &CanvasRenderingContext2d) -> ::alloc::string::String;
|
||||
# [wasm_bindgen (structural , method , setter , js_class = "CanvasRenderingContext2D" , js_name = shadowColor)]
|
||||
#[doc = "Setter for the `shadowColor` field of this object."]
|
||||
#[doc = ""]
|
||||
@ -290,7 +292,7 @@ extern "C" {
|
||||
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/font)"]
|
||||
#[doc = ""]
|
||||
#[doc = "*This API requires the following crate features to be activated: `CanvasRenderingContext2d`*"]
|
||||
pub fn font(this: &CanvasRenderingContext2d) -> String;
|
||||
pub fn font(this: &CanvasRenderingContext2d) -> ::alloc::string::String;
|
||||
# [wasm_bindgen (structural , method , setter , js_class = "CanvasRenderingContext2D" , js_name = font)]
|
||||
#[doc = "Setter for the `font` field of this object."]
|
||||
#[doc = ""]
|
||||
@ -304,7 +306,7 @@ extern "C" {
|
||||
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/textAlign)"]
|
||||
#[doc = ""]
|
||||
#[doc = "*This API requires the following crate features to be activated: `CanvasRenderingContext2d`*"]
|
||||
pub fn text_align(this: &CanvasRenderingContext2d) -> String;
|
||||
pub fn text_align(this: &CanvasRenderingContext2d) -> ::alloc::string::String;
|
||||
# [wasm_bindgen (structural , method , setter , js_class = "CanvasRenderingContext2D" , js_name = textAlign)]
|
||||
#[doc = "Setter for the `textAlign` field of this object."]
|
||||
#[doc = ""]
|
||||
@ -318,7 +320,7 @@ extern "C" {
|
||||
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/textBaseline)"]
|
||||
#[doc = ""]
|
||||
#[doc = "*This API requires the following crate features to be activated: `CanvasRenderingContext2d`*"]
|
||||
pub fn text_baseline(this: &CanvasRenderingContext2d) -> String;
|
||||
pub fn text_baseline(this: &CanvasRenderingContext2d) -> ::alloc::string::String;
|
||||
# [wasm_bindgen (structural , method , setter , js_class = "CanvasRenderingContext2D" , js_name = textBaseline)]
|
||||
#[doc = "Setter for the `textBaseline` field of this object."]
|
||||
#[doc = ""]
|
||||
|
@ -101,7 +101,9 @@ extern "C" {
|
||||
#[doc = ""]
|
||||
#[doc = "*This API requires the following crate features to be activated: `CaretStateChangedEventInit`*"]
|
||||
#[wasm_bindgen(method, getter = "selectedTextContent")]
|
||||
pub fn get_selected_text_content(this: &CaretStateChangedEventInit) -> Option<String>;
|
||||
pub fn get_selected_text_content(
|
||||
this: &CaretStateChangedEventInit,
|
||||
) -> Option<::alloc::string::String>;
|
||||
#[doc = "Change the `selectedTextContent` field of this object."]
|
||||
#[doc = ""]
|
||||
#[doc = "*This API requires the following crate features to be activated: `CaretStateChangedEventInit`*"]
|
||||
|
@ -18,7 +18,7 @@ extern "C" {
|
||||
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/CharacterData/data)"]
|
||||
#[doc = ""]
|
||||
#[doc = "*This API requires the following crate features to be activated: `CharacterData`*"]
|
||||
pub fn data(this: &CharacterData) -> String;
|
||||
pub fn data(this: &CharacterData) -> ::alloc::string::String;
|
||||
# [wasm_bindgen (structural , method , setter , js_class = "CharacterData" , js_name = data)]
|
||||
#[doc = "Setter for the `data` field of this object."]
|
||||
#[doc = ""]
|
||||
@ -88,8 +88,11 @@ extern "C" {
|
||||
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/CharacterData/substringData)"]
|
||||
#[doc = ""]
|
||||
#[doc = "*This API requires the following crate features to be activated: `CharacterData`*"]
|
||||
pub fn substring_data(this: &CharacterData, offset: u32, count: u32)
|
||||
-> Result<String, JsValue>;
|
||||
pub fn substring_data(
|
||||
this: &CharacterData,
|
||||
offset: u32,
|
||||
count: u32,
|
||||
) -> Result<::alloc::string::String, JsValue>;
|
||||
# [wasm_bindgen (catch , method , structural , variadic , js_class = "CharacterData" , js_name = after)]
|
||||
#[doc = "The `after()` method."]
|
||||
#[doc = ""]
|
||||
|
@ -14,7 +14,7 @@ extern "C" {
|
||||
#[doc = ""]
|
||||
#[doc = "*This API requires the following crate features to be activated: `CheckerboardReport`*"]
|
||||
#[wasm_bindgen(method, getter = "log")]
|
||||
pub fn get_log(this: &CheckerboardReport) -> Option<String>;
|
||||
pub fn get_log(this: &CheckerboardReport) -> Option<::alloc::string::String>;
|
||||
#[doc = "Change the `log` field of this object."]
|
||||
#[doc = ""]
|
||||
#[doc = "*This API requires the following crate features to be activated: `CheckerboardReport`*"]
|
||||
|
@ -24,7 +24,7 @@ extern "C" {
|
||||
#[doc = ""]
|
||||
#[doc = "*This API requires the following crate features to be activated: `ChromeFilePropertyBag`*"]
|
||||
#[wasm_bindgen(method, getter = "type")]
|
||||
pub fn get_type(this: &ChromeFilePropertyBag) -> Option<String>;
|
||||
pub fn get_type(this: &ChromeFilePropertyBag) -> Option<::alloc::string::String>;
|
||||
#[doc = "Change the `type` field of this object."]
|
||||
#[doc = ""]
|
||||
#[doc = "*This API requires the following crate features to be activated: `ChromeFilePropertyBag`*"]
|
||||
@ -44,7 +44,7 @@ extern "C" {
|
||||
#[doc = ""]
|
||||
#[doc = "*This API requires the following crate features to be activated: `ChromeFilePropertyBag`*"]
|
||||
#[wasm_bindgen(method, getter = "name")]
|
||||
pub fn get_name(this: &ChromeFilePropertyBag) -> Option<String>;
|
||||
pub fn get_name(this: &ChromeFilePropertyBag) -> Option<::alloc::string::String>;
|
||||
#[doc = "Change the `name` field of this object."]
|
||||
#[doc = ""]
|
||||
#[doc = "*This API requires the following crate features to be activated: `ChromeFilePropertyBag`*"]
|
||||
|
@ -18,7 +18,7 @@ extern "C" {
|
||||
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Client/url)"]
|
||||
#[doc = ""]
|
||||
#[doc = "*This API requires the following crate features to be activated: `Client`*"]
|
||||
pub fn url(this: &Client) -> String;
|
||||
pub fn url(this: &Client) -> ::alloc::string::String;
|
||||
#[cfg(feature = "FrameType")]
|
||||
# [wasm_bindgen (structural , method , getter , js_class = "Client" , js_name = frameType)]
|
||||
#[doc = "Getter for the `frameType` field of this object."]
|
||||
@ -41,7 +41,7 @@ extern "C" {
|
||||
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Client/id)"]
|
||||
#[doc = ""]
|
||||
#[doc = "*This API requires the following crate features to be activated: `Client`*"]
|
||||
pub fn id(this: &Client) -> String;
|
||||
pub fn id(this: &Client) -> ::alloc::string::String;
|
||||
# [wasm_bindgen (catch , method , structural , js_class = "Client" , js_name = postMessage)]
|
||||
#[doc = "The `postMessage()` method."]
|
||||
#[doc = ""]
|
||||
|
@ -32,7 +32,7 @@ extern "C" {
|
||||
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/CloseEvent/reason)"]
|
||||
#[doc = ""]
|
||||
#[doc = "*This API requires the following crate features to be activated: `CloseEvent`*"]
|
||||
pub fn reason(this: &CloseEvent) -> String;
|
||||
pub fn reason(this: &CloseEvent) -> ::alloc::string::String;
|
||||
#[wasm_bindgen(catch, constructor, js_class = "CloseEvent")]
|
||||
#[doc = "The `new CloseEvent(..)` constructor, creating a new instance of `CloseEvent`."]
|
||||
#[doc = ""]
|
||||
|
@ -54,7 +54,7 @@ extern "C" {
|
||||
#[doc = ""]
|
||||
#[doc = "*This API requires the following crate features to be activated: `CloseEventInit`*"]
|
||||
#[wasm_bindgen(method, getter = "reason")]
|
||||
pub fn get_reason(this: &CloseEventInit) -> Option<String>;
|
||||
pub fn get_reason(this: &CloseEventInit) -> Option<::alloc::string::String>;
|
||||
#[doc = "Change the `reason` field of this object."]
|
||||
#[doc = ""]
|
||||
#[doc = "*This API requires the following crate features to be activated: `CloseEventInit`*"]
|
||||
|
@ -14,7 +14,7 @@ extern "C" {
|
||||
#[doc = ""]
|
||||
#[doc = "*This API requires the following crate features to be activated: `CollectedClientData`*"]
|
||||
#[wasm_bindgen(method, getter = "challenge")]
|
||||
pub fn get_challenge(this: &CollectedClientData) -> String;
|
||||
pub fn get_challenge(this: &CollectedClientData) -> ::alloc::string::String;
|
||||
#[doc = "Change the `challenge` field of this object."]
|
||||
#[doc = ""]
|
||||
#[doc = "*This API requires the following crate features to be activated: `CollectedClientData`*"]
|
||||
@ -54,7 +54,7 @@ extern "C" {
|
||||
#[doc = "*This API requires the following crate features to be activated: `CollectedClientData`*"]
|
||||
#[deprecated]
|
||||
#[wasm_bindgen(method, getter = "hashAlgorithm")]
|
||||
pub fn get_hash_algorithm(this: &CollectedClientData) -> String;
|
||||
pub fn get_hash_algorithm(this: &CollectedClientData) -> ::alloc::string::String;
|
||||
#[doc = "Change the `hashAlgorithm` field of this object."]
|
||||
#[doc = ""]
|
||||
#[doc = "*This API requires the following crate features to be activated: `CollectedClientData`*"]
|
||||
@ -65,7 +65,7 @@ extern "C" {
|
||||
#[doc = ""]
|
||||
#[doc = "*This API requires the following crate features to be activated: `CollectedClientData`*"]
|
||||
#[wasm_bindgen(method, getter = "origin")]
|
||||
pub fn get_origin(this: &CollectedClientData) -> String;
|
||||
pub fn get_origin(this: &CollectedClientData) -> ::alloc::string::String;
|
||||
#[doc = "Change the `origin` field of this object."]
|
||||
#[doc = ""]
|
||||
#[doc = "*This API requires the following crate features to be activated: `CollectedClientData`*"]
|
||||
@ -88,7 +88,7 @@ extern "C" {
|
||||
#[doc = "*This API requires the following crate features to be activated: `CollectedClientData`*"]
|
||||
#[deprecated]
|
||||
#[wasm_bindgen(method, getter = "tokenBindingId")]
|
||||
pub fn get_token_binding_id(this: &CollectedClientData) -> Option<String>;
|
||||
pub fn get_token_binding_id(this: &CollectedClientData) -> Option<::alloc::string::String>;
|
||||
#[doc = "Change the `tokenBindingId` field of this object."]
|
||||
#[doc = ""]
|
||||
#[doc = "*This API requires the following crate features to be activated: `CollectedClientData`*"]
|
||||
@ -99,7 +99,7 @@ extern "C" {
|
||||
#[doc = ""]
|
||||
#[doc = "*This API requires the following crate features to be activated: `CollectedClientData`*"]
|
||||
#[wasm_bindgen(method, getter = "type")]
|
||||
pub fn get_type(this: &CollectedClientData) -> String;
|
||||
pub fn get_type(this: &CollectedClientData) -> ::alloc::string::String;
|
||||
#[doc = "Change the `type` field of this object."]
|
||||
#[doc = ""]
|
||||
#[doc = "*This API requires the following crate features to be activated: `CollectedClientData`*"]
|
||||
|
@ -18,14 +18,14 @@ extern "C" {
|
||||
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/CompositionEvent/data)"]
|
||||
#[doc = ""]
|
||||
#[doc = "*This API requires the following crate features to be activated: `CompositionEvent`*"]
|
||||
pub fn data(this: &CompositionEvent) -> Option<String>;
|
||||
pub fn data(this: &CompositionEvent) -> Option<::alloc::string::String>;
|
||||
# [wasm_bindgen (structural , method , getter , js_class = "CompositionEvent" , js_name = locale)]
|
||||
#[doc = "Getter for the `locale` field of this object."]
|
||||
#[doc = ""]
|
||||
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/CompositionEvent/locale)"]
|
||||
#[doc = ""]
|
||||
#[doc = "*This API requires the following crate features to be activated: `CompositionEvent`*"]
|
||||
pub fn locale(this: &CompositionEvent) -> String;
|
||||
pub fn locale(this: &CompositionEvent) -> ::alloc::string::String;
|
||||
#[wasm_bindgen(catch, constructor, js_class = "CompositionEvent")]
|
||||
#[doc = "The `new CompositionEvent(..)` constructor, creating a new instance of `CompositionEvent`."]
|
||||
#[doc = ""]
|
||||
|
@ -66,7 +66,7 @@ extern "C" {
|
||||
#[doc = ""]
|
||||
#[doc = "*This API requires the following crate features to be activated: `CompositionEventInit`*"]
|
||||
#[wasm_bindgen(method, getter = "data")]
|
||||
pub fn get_data(this: &CompositionEventInit) -> Option<String>;
|
||||
pub fn get_data(this: &CompositionEventInit) -> Option<::alloc::string::String>;
|
||||
#[doc = "Change the `data` field of this object."]
|
||||
#[doc = ""]
|
||||
#[doc = "*This API requires the following crate features to be activated: `CompositionEventInit`*"]
|
||||
|
@ -46,7 +46,7 @@ extern "C" {
|
||||
#[doc = ""]
|
||||
#[doc = "*This API requires the following crate features to be activated: `ComputedEffectTiming`*"]
|
||||
#[wasm_bindgen(method, getter = "easing")]
|
||||
pub fn get_easing(this: &ComputedEffectTiming) -> Option<String>;
|
||||
pub fn get_easing(this: &ComputedEffectTiming) -> Option<::alloc::string::String>;
|
||||
#[doc = "Change the `easing` field of this object."]
|
||||
#[doc = ""]
|
||||
#[doc = "*This API requires the following crate features to be activated: `ComputedEffectTiming`*"]
|
||||
|
@ -14,7 +14,7 @@ extern "C" {
|
||||
#[doc = ""]
|
||||
#[doc = "*This API requires the following crate features to be activated: `ConnStatusDict`*"]
|
||||
#[wasm_bindgen(method, getter = "status")]
|
||||
pub fn get_status(this: &ConnStatusDict) -> Option<String>;
|
||||
pub fn get_status(this: &ConnStatusDict) -> Option<::alloc::string::String>;
|
||||
#[doc = "Change the `status` field of this object."]
|
||||
#[doc = ""]
|
||||
#[doc = "*This API requires the following crate features to be activated: `ConnStatusDict`*"]
|
||||
|
@ -24,7 +24,7 @@ extern "C" {
|
||||
#[doc = ""]
|
||||
#[doc = "*This API requires the following crate features to be activated: `ConsoleCounter`*"]
|
||||
#[wasm_bindgen(method, getter = "label")]
|
||||
pub fn get_label(this: &ConsoleCounter) -> Option<String>;
|
||||
pub fn get_label(this: &ConsoleCounter) -> Option<::alloc::string::String>;
|
||||
#[doc = "Change the `label` field of this object."]
|
||||
#[doc = ""]
|
||||
#[doc = "*This API requires the following crate features to be activated: `ConsoleCounter`*"]
|
||||
|
@ -14,7 +14,7 @@ extern "C" {
|
||||
#[doc = ""]
|
||||
#[doc = "*This API requires the following crate features to be activated: `ConsoleCounterError`*"]
|
||||
#[wasm_bindgen(method, getter = "error")]
|
||||
pub fn get_error(this: &ConsoleCounterError) -> Option<String>;
|
||||
pub fn get_error(this: &ConsoleCounterError) -> Option<::alloc::string::String>;
|
||||
#[doc = "Change the `error` field of this object."]
|
||||
#[doc = ""]
|
||||
#[doc = "*This API requires the following crate features to be activated: `ConsoleCounterError`*"]
|
||||
@ -24,7 +24,7 @@ extern "C" {
|
||||
#[doc = ""]
|
||||
#[doc = "*This API requires the following crate features to be activated: `ConsoleCounterError`*"]
|
||||
#[wasm_bindgen(method, getter = "label")]
|
||||
pub fn get_label(this: &ConsoleCounterError) -> Option<String>;
|
||||
pub fn get_label(this: &ConsoleCounterError) -> Option<::alloc::string::String>;
|
||||
#[doc = "Change the `label` field of this object."]
|
||||
#[doc = ""]
|
||||
#[doc = "*This API requires the following crate features to be activated: `ConsoleCounterError`*"]
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user