### JsString::starts_with Example Source: https://docs.rs/js-sys/latest/js_sys/Intl/fn.supported_values_of.html?search=u32+-%3E+bool The `starts_with` method checks if a `JsString` begins with a specified substring. The third argument is an optional position to start the search. ```rust JsString::new("hello").starts_with("he", 0) ``` -------------------------------- ### DurationFormatPart Search Examples Source: https://docs.rs/js-sys/latest/js_sys/Intl/struct.DurationFormatPart.html?search= Demonstrates example searches for DurationFormatPart, showing common patterns and types. ```APIDOC ## Example Searches This section provides examples of how to search for `DurationFormatPart` and related types. ### Search Patterns - `std::vec` - `u32 -> bool` - `Option, (T -> U) -> Option` ``` -------------------------------- ### RelativeTimeFormatPart Search Examples Source: https://docs.rs/js-sys/latest/js_sys/Intl/struct.RelativeTimeFormatPart.html?search= Examples of how to perform searches for RelativeTimeFormatPart, demonstrating various query patterns. ```APIDOC ## Search Examples ### Description Provides examples of search queries that can be used to find `RelativeTimeFormatPart` or related functionalities. ### Example Searches - `std::vec` - `u32 -> bool` - `Option, (T -> U) -> Option` ``` -------------------------------- ### Example Searches for ResolvedListFormatOptions Source: https://docs.rs/js-sys/latest/js_sys/Intl/struct.ResolvedListFormatOptions.html?search= Demonstrates various ways to search for resolved list format options. These examples show how to query for specific types, conversions, and options involving Option and generic types. ```APIDOC ## Example Searches ### Description These examples illustrate common search patterns for resolved list format options. ### Searches - `std::vec` - `u32 -> bool` - `Option, (T -> U) -> Option` ``` -------------------------------- ### RuntimeError Search Examples Source: https://docs.rs/js-sys/latest/js_sys/WebAssembly/struct.RuntimeError.html?search= Examples of how to search for runtime errors. These demonstrate common search patterns and types of conversions. ```APIDOC ## RuntimeError Search ### Description Provides examples of search queries for runtime errors. ### Example Searches * `std::vec` * `u32 -> bool` * `Option, (T -> U) -> Option` ``` -------------------------------- ### RelativeTimeFormat search examples Source: https://docs.rs/js-sys/latest/js_sys/Intl/struct.RelativeTimeFormat.html?search= Examples of how to search for specific types and methods within the js_sys Intl RelativeTimeFormat module. ```APIDOC ## Search Examples This section provides examples of common search queries for the `js_sys.Intl.RelativeTimeFormat` module. ### Example Searches * `std::vec` * `u32 -> bool` * `Option, (T -> U) -> Option` ``` -------------------------------- ### RelativeTimeFormatOptions Search Examples Source: https://docs.rs/js-sys/latest/js_sys/Intl/struct.RelativeTimeFormatOptions.html?search= Examples of how to search for specific types or conversions within the js_sys Intl RelativeTimeFormatOptions. ```APIDOC ## Search Examples ### Example Searches - `std::vec` - `u32 -> bool` - `Option, (T -> U) -> Option` ``` -------------------------------- ### pad_start Source: https://docs.rs/js-sys/latest/js_sys/struct.JsString.html The `padStart()` method pads the current string with another string (repeated, if needed) so that the resulting string reaches the given length. The padding is applied from the start (left) of the current string. ```APIDOC ## pub fn pad_start(&self, target_length: u32, pad_string: &str) -> JsString ### Description The `padStart()` method pads the current string with another string (repeated, if needed) so that the resulting string reaches the given length. The padding is applied from the start (left) of the current string. ### Parameters #### Path Parameters - `target_length` (u32) - The target length of the resulting string. - `pad_string` (str) - The string to use for padding. ### Returns - `JsString` - The padded string. ``` -------------------------------- ### RegExp last_index() Method Source: https://docs.rs/js-sys/latest/js_sys/struct.RegExp.html?search= Gets the index at which to start the next match. This is a read/write property. ```rust pub fn last_index(&self) -> u32 ``` -------------------------------- ### Example Search: std::vec Source: https://docs.rs/js-sys/latest/js_sys/struct.Boolean.html?search= Demonstrates a basic search pattern for 'std::vec'. ```text std::vec ``` -------------------------------- ### get_float64 Source: https://docs.rs/js-sys/latest/js_sys/struct.DataView.html Gets a signed 64-bit float (double) at the specified byte offset from the start of the DataView. ```APIDOC ## get_float64 ### Description Gets a signed 64-bit float (double) at the specified byte offset from the start of the DataView. ### Method GET (conceptual) ### Endpoint N/A (Method on DataView object) ### Parameters #### Path Parameters None #### Query Parameters None #### Path Parameters - **byte_offset** (usize) - Required - The byte offset from the start of the DataView. ### Request Example None (Method call) ### Response #### Success Response - **Return Value** (f64) - The signed 64-bit float (double) value. #### Response Example None (Method call) ``` -------------------------------- ### padStart Source: https://docs.rs/js-sys/latest/js_sys/struct.JsString.html?search=std%3A%3Avec Pads the current string with a given string so that the resulting string reaches a specified length, applying padding from the start. ```APIDOC ## padStart ### Description Pads the current string with another string (repeated, if needed) so that the resulting string reaches the given length. The padding is applied from the start (left) of the current string. ### Method `padStart(target_length: u32, pad_string: &str) -> JsString` ### Parameters * `target_length` (u32) - The desired length of the resulting string. * `pad_string` (str) - The string to use for padding. ### Returns * `JsString` - The padded string. ``` -------------------------------- ### Get Byte Offset of BigInt64Array Source: https://docs.rs/js-sys/latest/js_sys/struct.BigInt64Array.html?search=std%3A%3Avec Returns the offset in bytes from the start of the ArrayBuffer to the beginning of the BigInt64Array. ```rust pub fn byte_offset(&self) -> u32 ``` -------------------------------- ### DataView::get_float32 Source: https://docs.rs/js-sys/latest/js_sys/struct.DataView.html Gets a signed 32-bit float (float) at the specified byte offset from the start of the DataView. ```APIDOC ## DataView::get_float32 ### Description Gets a signed 32-bit float (float) at the specified byte offset from the start of the `DataView`. ### Method `DataView::get_float32` ### Parameters - `byte_offset` (usize) - The byte offset from the start of the DataView. ### Returns `f32` - The signed 32-bit float value. ``` -------------------------------- ### WebAssembly.instantiate() (Buffer) Source: https://docs.rs/js-sys/latest/js_sys/WebAssembly/index.html?search=u32+-%3E+bool Allows compilation and instantiation of WebAssembly code from a buffer. ```APIDOC ## WebAssembly.instantiate() (Buffer) ### Description Allows you to compile and instantiate WebAssembly code from a buffer. ### Method Not specified (assumed to be a function call) ### Parameters None explicitly documented for direct call. ### Response Returns an instantiated WebAssembly module. ``` -------------------------------- ### DataView::get_int32 Source: https://docs.rs/js-sys/latest/js_sys/struct.DataView.html Gets a signed 32-bit integer (long) at the specified byte offset from the start of the DataView. ```APIDOC ## DataView::get_int32 ### Description Gets a signed 32-bit integer (long) at the specified byte offset from the start of the `DataView`. ### Method `DataView::get_int32` ### Parameters - `byte_offset` (usize) - The byte offset from the start of the DataView. ### Returns `i32` - The signed 32-bit integer value. ``` -------------------------------- ### DataView::get_int16 Source: https://docs.rs/js-sys/latest/js_sys/struct.DataView.html Gets a signed 16-bit integer (short) at the specified byte offset from the start of the DataView. ```APIDOC ## DataView::get_int16 ### Description Gets a signed 16-bit integer (short) at the specified byte offset from the start of the `DataView`. ### Method `DataView::get_int16` ### Parameters - `byte_offset` (usize) - The byte offset from the start of the DataView. ### Returns `i16` - The signed 16-bit integer value. ``` -------------------------------- ### pad_start Source: https://docs.rs/js-sys/latest/js_sys/struct.JsString.html?search=u32+-%3E+bool Pads the current string with a given string so that the resulting string reaches a specified length, applying padding from the start. ```APIDOC ## pad_start ### Description Pads the current string with another string (repeated, if needed) so that the resulting string reaches the given length. The padding is applied from the start (left) of the current string. ### Method `pad_start(&self, target_length: u32, pad_string: &str) -> JsString` ### Parameters - `target_length` (u32): The desired length of the resulting string. - `pad_string` (&str): The string to use for padding. ### Returns - `JsString`: The padded string. ``` -------------------------------- ### PluralRules Search Examples Source: https://docs.rs/js-sys/latest/js_sys/Intl/struct.PluralRules.html?search= Demonstrates common search patterns for PluralRules. These examples show how to search for specific types, conversions, and generic types within the PluralRules functionality. ```APIDOC ## PluralRules Search Examples ### Description This section provides examples of how to search for PluralRules within the `js_sys::Intl` module. These examples illustrate common patterns for finding specific types, conversion functions, and generic type implementations. ### Example Searches * `std::vec` * `u32 -> bool` * `Option, (T -> U) -> Option` ``` -------------------------------- ### DataView::get_uint8 Source: https://docs.rs/js-sys/latest/js_sys/struct.DataView.html Gets an unsigned 8-bit integer (byte) at the specified byte offset from the start of the DataView. ```APIDOC ## DataView::get_uint8 ### Description Gets an unsigned 8-bit integer (byte) at the specified byte offset from the start of the `DataView`. ### Method `DataView::get_uint8` ### Parameters - `byte_offset` (usize) - The byte offset from the start of the DataView. ### Returns `u8` - The unsigned 8-bit integer value. ``` -------------------------------- ### Binding JavaScript Functions with Predefined Arguments Source: https://docs.rs/js-sys/latest/js_sys/struct.Function.html?search=u32+-%3E+bool Illustrates how to create a new JavaScript function with some arguments pre-filled using the `bind` method. Examples cover binding no arguments, one argument, and two arguments, showing how the function signature changes accordingly. ```rust let f: Function Number> = get_fn(); let bound: Function Number> = f.bind(&ctx, ()); ``` ```rust let f: Function Number> = get_fn(); let bound: Function Number> = f.bind(&ctx, (&my_string,)); ``` ```rust let f: Function Number> = get_fn(); let bound: Function Number> = f.bind(&ctx, (&my_string, &my_bool)); ``` -------------------------------- ### Binding JavaScript Functions with Arguments Source: https://docs.rs/js-sys/latest/js_sys/struct.Function.html?search= Illustrates how to create new functions with pre-bound arguments using the `bind` method. Examples cover binding no arguments, one argument, and two arguments, showing how the function signature changes accordingly. ```rust let f: Function Number> = get_fn(); // Bind no args - same signature let bound: Function Number> = f.bind(&ctx, ()); ``` ```rust // Bind one arg (use 1-tuple of references) let bound: Function Number> = f.bind(&ctx, (&my_string,)); ``` ```rust // Bind two args - becomes 0-arg function let bound: Function Number> = f.bind(&ctx, (&my_string, &my_bool)); ``` -------------------------------- ### DataView::get_int8 Source: https://docs.rs/js-sys/latest/js_sys/struct.DataView.html Gets a signed 8-bit integer (byte) at the specified byte offset from the start of the DataView. ```APIDOC ## DataView::get_int8 ### Description Gets a signed 8-bit integer (byte) at the specified byte offset from the start of the `DataView`. ### Method `DataView::get_int8` ### Parameters - `byte_offset` (usize) - The byte offset from the start of the DataView. ### Returns `i8` - The signed 8-bit integer value. ``` -------------------------------- ### Example Search: Option, (T to U) to Option Source: https://docs.rs/js-sys/latest/js_sys/struct.Boolean.html?search= Shows a search pattern for mapping functions over Option types. ```text Option, (T -> U) -> Option ``` -------------------------------- ### get_float64_endian Source: https://docs.rs/js-sys/latest/js_sys/struct.DataView.html Gets a signed 64-bit float (double) at the specified byte offset from the start of the DataView, with control over endianness. ```APIDOC ## get_float64_endian ### Description Gets a signed 64-bit float (double) at the specified byte offset from the start of the DataView. The endianness can be specified. ### Method GET (conceptual) ### Endpoint N/A (Method on DataView object) ### Parameters #### Path Parameters None #### Query Parameters None #### Path Parameters - **byte_offset** (usize) - Required - The byte offset from the start of the DataView. - **little_endian** (bool) - Required - Specifies the endianness. `true` for little-endian, `false` for big-endian. ### Request Example None (Method call) ### Response #### Success Response - **Return Value** (f64) - The signed 64-bit float (double) value. #### Response Example None (Method call) ``` -------------------------------- ### get_float16_endian_as_f32 Source: https://docs.rs/js-sys/latest/js_sys/struct.DataView.html Gets a signed 16-bit float at the specified byte offset from the start of the DataView as an f32. The endianness can be specified. ```APIDOC ## get_float16_endian_as_f32 ### Description Gets a signed 16-bit float at the specified byte offset from the start of the DataView as an `f32`. The endianness can be specified. ### Method GET (conceptual) ### Endpoint N/A (Method on DataView object) ### Parameters #### Path Parameters None #### Query Parameters None #### Path Parameters - **byte_offset** (usize) - Required - The byte offset from the start of the DataView. - **little_endian** (bool) - Required - Specifies the endianness. `true` for little-endian, `false` for big-endian. ### Request Example None (Method call) ### Response #### Success Response - **Return Value** (f32) - The signed 16-bit float value as an f32. #### Response Example None (Method call) ``` -------------------------------- ### JsOption Search Examples Source: https://docs.rs/js-sys/latest/js_sys/struct.JsOption.html?search= Demonstrates various search patterns and type conversions related to JsOption. ```APIDOC ## JsOption Search This section provides examples of how to search and perform type conversions with JsOption. ### Example Searches - `std::vec` - `u32 -> bool` - `Option, (T -> U) -> Option` These examples illustrate common search queries and type transformations that can be performed. ``` -------------------------------- ### DataView::get_uint32 Source: https://docs.rs/js-sys/latest/js_sys/struct.DataView.html Gets an unsigned 32-bit integer (unsigned long) at the specified byte offset from the start of the view. ```APIDOC ## DataView::get_uint32 ### Description Gets an unsigned 32-bit integer (unsigned long) at the specified byte offset from the start of the `DataView`. ### Method `DataView::get_uint32` ### Parameters - `byte_offset` (usize) - The byte offset from the start of the DataView. ### Returns `u32` - The unsigned 32-bit integer value. ``` -------------------------------- ### Instance::new Source: https://docs.rs/js-sys/latest/js_sys/WebAssembly/struct.Instance.html Constructs a new WebAssembly Instance synchronously. This is an alternative to the asynchronous instantiation methods. ```APIDOC ## pub fn new(module: &Module, imports: &Object) -> Result ### Description Instantiates a given `WebAssembly.Module` object synchronously. ### Method `Instance::new` ### Parameters #### Path Parameters - `module` (&Module) - The WebAssembly module to instantiate. - `imports` (&Object) - An object containing the imports for the module. ### Returns A `Result` containing the `Instance` on success, or a `JsValue` error on failure. ``` -------------------------------- ### Example Searches for NumberFormatPart Source: https://docs.rs/js-sys/latest/js_sys/Intl/struct.NumberFormatPart.html?search= Demonstrates various ways to search for NumberFormatPart, illustrating different patterns and types. ```APIDOC ## Example Searches ### Description Provides examples of search queries for NumberFormatPart. ### Searches - `std::vec` - `u32 -> bool` - `Option, (T -> U) -> Option` ``` -------------------------------- ### DataView::get_uint16 Source: https://docs.rs/js-sys/latest/js_sys/struct.DataView.html Gets an unsigned 16-bit integer (unsigned short) at the specified byte offset from the start of the view. ```APIDOC ## DataView::get_uint16 ### Description Gets an unsigned 16-bit integer (unsigned short) at the specified byte offset from the start of the `DataView`. ### Method `DataView::get_uint16` ### Parameters - `byte_offset` (usize) - The byte offset from the start of the DataView. ### Returns `u16` - The unsigned 16-bit integer value. ``` -------------------------------- ### Get Unsigned 8-bit Integer Source: https://docs.rs/js-sys/latest/js_sys/struct.DataView.html?search=std%3A%3Avec Retrieves an unsigned 8-bit integer (byte) at the specified byte offset from the start of the DataView. ```rust pub fn get_uint8(&self, byte_offset: usize) -> u8 ``` -------------------------------- ### WebAssembly.instantiate Source: https://docs.rs/js-sys/latest/js_sys/WebAssembly/index.html?search= The `WebAssembly.instantiate()` function allows you to compile and instantiate WebAssembly code. ```APIDOC ## WebAssembly.instantiate ### Description Compiles and instantiates WebAssembly code. ### Usage ```javascript WebAssembly.instantiate(bytes, importObject) ``` ### Parameters * **bytes** (ArrayBuffer | TypedArray) - The WebAssembly binary code. * **importObject** (object) - Optional - An object containing imports for the module. ### Response #### Success Response * **instance** (WebAssembly.Instance) - The instantiated WebAssembly instance. * **module** (WebAssembly.Module) - The compiled WebAssembly module. ### Response Example ```json { "instance": "WebAssembly.Instance", "module": "WebAssembly.Module" } ``` ``` -------------------------------- ### Get Signed 8-bit Integer Source: https://docs.rs/js-sys/latest/js_sys/struct.DataView.html?search=std%3A%3Avec Retrieves a signed 8-bit integer (byte) at the specified byte offset from the start of the DataView. ```rust pub fn get_int8(&self, byte_offset: usize) -> i8 ``` -------------------------------- ### Example: Function taking String and Number, returning Boolean Source: https://docs.rs/js-sys/latest/js_sys/struct.Function.html?search=u32+-%3E+bool Shows how to declare a `Function` that accepts a `String` and a `Number` as arguments and returns a `Boolean`. ```rust // A function taking (String, Number) and returning Boolean let f: Function = get_some_fn(); ``` -------------------------------- ### DataView::get_float32_endian Source: https://docs.rs/js-sys/latest/js_sys/struct.DataView.html Gets a signed 32-bit float (float) at the specified byte offset from the start of the DataView, respecting the given endianness. ```APIDOC ## DataView::get_float32_endian ### Description Gets a signed 32-bit float (float) at the specified byte offset from the start of the `DataView`, respecting the given endianness. ### Method `DataView::get_float32_endian` ### Parameters - `byte_offset` (usize) - The byte offset from the start of the DataView. - `little_endian` (bool) - `true` for little-endian, `false` for big-endian. ### Returns `f32` - The signed 32-bit float value. ``` -------------------------------- ### DateTimeFormatPart Search Examples Source: https://docs.rs/js-sys/latest/js_sys/Intl/struct.DateTimeFormatPart.html?search= Demonstrates various ways to search for DateTimeFormatPart, illustrating common patterns and type conversions. ```APIDOC ## DateTimeFormatPart Search ### Description Provides examples of how to search for and utilize `DateTimeFormatPart` within the `js_sys::Intl` module. These examples cover common search patterns and type conversions. ### Example Searches * `std::vec` * `u32 -> bool` * `Option, (T -> U) -> Option` ``` -------------------------------- ### ErrorOptions Source: https://docs.rs/js-sys/latest/src/js_sys/lib.rs.html?search=Option%3CT%3E%2C+%28T+-%3E+U%29+-%3E+Option%3CU%3E Provides methods to get and set the 'cause' property of an ErrorOptions dictionary, and a constructor to create a new ErrorOptions with a given cause. ```APIDOC ## ErrorOptions ### Description Represents options for JavaScript errors, specifically focusing on the `cause` property. ### Methods #### `get_cause()` Retrieves the `cause` property of the `ErrorOptions`. - **Returns**: `JsValue` - The value of the `cause` property. #### `set_cause(cause: &JsValue)` Sets the `cause` property of this `ErrorOptions` dictionary. - **Parameters**: - **cause** (`&JsValue`) - Required - The value to set for the `cause` property. ### Constructor #### `new(cause: &JsValue)` Constructs a new `ErrorOptions` dictionary with the given `cause`. - **Parameters**: - **cause** (`&JsValue`) - Required - The cause to initialize the `ErrorOptions` with. - **Returns**: `Self` - A new `ErrorOptions` instance. ``` -------------------------------- ### DataView::get_int32_endian Source: https://docs.rs/js-sys/latest/js_sys/struct.DataView.html Gets a signed 32-bit integer (long) at the specified byte offset from the start of the DataView, respecting the given endianness. ```APIDOC ## DataView::get_int32_endian ### Description Gets a signed 32-bit integer (long) at the specified byte offset from the start of the `DataView`, respecting the given endianness. ### Method `DataView::get_int32_endian` ### Parameters - `byte_offset` (usize) - The byte offset from the start of the DataView. - `little_endian` (bool) - `true` for little-endian, `false` for big-endian. ### Returns `i32` - The signed 32-bit integer value. ``` -------------------------------- ### DataView::get_int16_endian Source: https://docs.rs/js-sys/latest/js_sys/struct.DataView.html Gets a signed 16-bit integer (short) at the specified byte offset from the start of the DataView, respecting the given endianness. ```APIDOC ## DataView::get_int16_endian ### Description Gets a signed 16-bit integer (short) at the specified byte offset from the start of the `DataView`, respecting the given endianness. ### Method `DataView::get_int16_endian` ### Parameters - `byte_offset` (usize) - The byte offset from the start of the DataView. - `little_endian` (bool) - `true` for little-endian, `false` for big-endian. ### Returns `i16` - The signed 16-bit integer value. ``` -------------------------------- ### Instance::new Source: https://docs.rs/js-sys/latest/js_sys/WebAssembly/struct.Instance.html?search=Option%3CT%3E%2C+%28T+-%3E+U%29+-%3E+Option%3CU%3E Constructs a new WebAssembly Instance by synchronously instantiating a Module with provided imports. While functional, `instantiateStreaming` is the primary asynchronous method for instantiation. ```APIDOC ## Instance::new ### Description Instantiates a `WebAssembly.Module` synchronously with the given imports. This constructor is available, but `WebAssembly.instantiateStreaming()` is the recommended asynchronous approach. ### Method `Instance::new(module: &Module, imports: &Object) -> Result` ### Parameters #### Path Parameters - `module` (*Module*) - The WebAssembly module to instantiate. - `imports` (*Object*) - An object containing the necessary imports for the module. ### Returns - `Result` - Ok containing the `Instance` on success, or a `JsValue` error on failure. ``` -------------------------------- ### length (getter) Source: https://docs.rs/js-sys/latest/src/js_sys/lib.rs.html?search=u32+-%3E+bool Gets the number of elements in the array. ```APIDOC ## length (getter) ### Description Retrieves the number of elements currently in the array. ### Method `length(this: &Array) -> u32` ### Returns A `u32` representing the number of elements in the array. ``` -------------------------------- ### DataView::get_uint32_endian Source: https://docs.rs/js-sys/latest/js_sys/struct.DataView.html Gets an unsigned 32-bit integer (unsigned long) at the specified byte offset from the start of the view, respecting the given endianness. ```APIDOC ## DataView::get_uint32_endian ### Description Gets an unsigned 32-bit integer (unsigned long) at the specified byte offset from the start of the `DataView`, respecting the given endianness. ### Method `DataView::get_uint32_endian` ### Parameters - `byte_offset` (usize) - The byte offset from the start of the DataView. - `little_endian` (bool) - `true` for little-endian, `false` for big-endian. ### Returns `u32` - The unsigned 32-bit integer value. ``` -------------------------------- ### indexOf Source: https://docs.rs/js-sys/latest/src/js_sys/lib.rs.html?search=u32+-%3E+bool Returns the first index at which a given element can be found in the array, or -1 if it is not present. Optionally takes a starting index. ```APIDOC ## indexOf ### Description Finds the first occurrence of a specified element in the array and returns its index. If the element is not found, it returns -1. ### Method `index_of(value: &T, from_index: i32) -> i32` ### Parameters - `value`: The element to search for within the array. - `from_index`: The index at which to begin searching the array. Defaults to 0 if not provided or if negative. ### Returns The first index of the `value` in the array, or -1 if not found. ``` -------------------------------- ### DataView::get_uint16_endian Source: https://docs.rs/js-sys/latest/js_sys/struct.DataView.html Gets an unsigned 16-bit integer (unsigned short) at the specified byte offset from the start of the view, respecting the given endianness. ```APIDOC ## DataView::get_uint16_endian ### Description Gets an unsigned 16-bit integer (unsigned short) at the specified byte offset from the start of the `DataView`, respecting the given endianness. ### Method `DataView::get_uint16_endian` ### Parameters - `byte_offset` (usize) - The byte offset from the start of the DataView. - `little_endian` (bool) - `true` for little-endian, `false` for big-endian. ### Returns `u16` - The unsigned 16-bit integer value. ``` -------------------------------- ### From and Into Implementations Source: https://docs.rs/js-sys/latest/js_sys/Intl/struct.CollatorOptions.html Explains the `From` and `Into` trait implementations, enabling straightforward conversions between types. ```APIDOC ## fn from(t: T) -> T ### Description Returns the argument unchanged. ### Method `from` ### Parameters - `t` (T): The value to convert. ### Response - `T`: The argument unchanged. ## fn into(self) -> U ### Description Calls `U::from(self)`. ### Method `into` ### Parameters None ### Response - `U`: The result of the `From` conversion. ``` -------------------------------- ### DataView::get_float32 Source: https://docs.rs/js-sys/latest/js_sys/struct.DataView.html?search=std%3A%3Avec Gets a signed 32-bit float (float) at the specified byte offset from the start of the DataView, using the platform's default endianness. ```APIDOC ## DataView::get_float32 ### Description Gets a signed 32-bit float (float) at the specified byte offset from the start of the `DataView`, using the platform's default endianness. ### Signature ```rust pub fn get_float32(&self, byte_offset: usize) -> f32 ``` ### Parameters * `byte_offset`: The offset in bytes from the start of the `DataView`. ### Returns The signed 32-bit float at the specified offset. ``` -------------------------------- ### instantiate_buffer Source: https://docs.rs/js-sys/latest/js_sys/WebAssembly/fn.instantiate_buffer.html?search=Option%3CT%3E%2C+%28T+-%3E+U%29+-%3E+Option%3CU%3E Compiles and instantiates a WebAssembly module from a byte buffer. It takes the buffer containing the WebAssembly code and an object of imported functions, returning a Promise that resolves to a JsValue representing the instantiated module. ```APIDOC ## instantiate_buffer ### Description The `WebAssembly.instantiate()` function allows you to compile and instantiate WebAssembly code. ### Method Signature `pub fn instantiate_buffer(buffer: &[u8], imports: &Object) -> Promise` ### Parameters * **buffer** (`&[u8]`) - Required - A byte slice containing the WebAssembly module code. * **imports** (`&Object`) - Required - An object containing any imported functions or objects required by the WebAssembly module. ### Returns * **Promise** - A Promise that resolves to a `JsValue` representing the instantiated WebAssembly module. This `JsValue` typically contains the module and its exports. ``` -------------------------------- ### Get Element from Array Source: https://docs.rs/js-sys/latest/src/js_sys/lib.rs.html?search=Option%3CT%3E%2C+%28T+-%3E+U%29+-%3E+Option%3CU%3E Retrieves an element from a JavaScript Array at a specified index. Returns `Option` which is `None` if the index is out of bounds or the element is `undefined`. ```rust /// or if the element is explicitly `undefined`). #[wasm_bindgen(method, indexing_getter)] pub fn get_checked(this: &Array, index: u32) -> Option; ``` -------------------------------- ### DataView::get_int16 Source: https://docs.rs/js-sys/latest/js_sys/struct.DataView.html?search=std%3A%3Avec Gets a signed 16-bit integer (short) at the specified byte offset from the start of the DataView, using the platform's default endianness. ```APIDOC ## DataView::get_int16 ### Description Gets a signed 16-bit integer (short) at the specified byte offset from the start of the `DataView`, using the platform's default endianness. ### Signature ```rust pub fn get_int16(&self, byte_offset: usize) -> i16 ``` ### Parameters * `byte_offset`: The offset in bytes from the start of the `DataView`. ### Returns The signed 16-bit integer at the specified offset. ``` -------------------------------- ### Create a new WebAssembly Module Source: https://docs.rs/js-sys/latest/js_sys/WebAssembly/struct.Module.html Instantiates a new WebAssembly Module from a buffer source. This compiled module can then be instantiated multiple times. ```rust pub fn new(buffer_source: &JsValue) -> Result ``` -------------------------------- ### From Conversions to Object Source: https://docs.rs/js-sys/latest/js_sys/struct.Object.html Shows how various types can be converted into an `Object`. ```APIDOC ## fn from(obj: AggregateError) -> Object ### Description Converts `AggregateError` to `Object`. ## fn from(obj: Array) -> Object ### Description Converts `Array` to `Object`. ## fn from(obj: ArrayBuffer) -> Object ### Description Converts `ArrayBuffer` to `Object`. ## fn from(obj: ArrayBufferOptions) -> Object ### Description Converts `ArrayBufferOptions` to `Object`. ## fn from(obj: ArrayTuple) -> Object ### Description Converts `ArrayTuple` to `Object`. ## fn from(obj: AsyncGenerator) -> Object ### Description Converts `AsyncGenerator` to `Object`. ## fn from(obj: BigInt) -> Object ### Description Converts `BigInt` to `Object`. ## fn from(obj: BigInt64Array) -> Object ### Description Converts `BigInt64Array` to `Object`. ## fn from(obj: BigUint64Array) -> Object ### Description Converts `BigUint64Array` to `Object`. ## fn from(obj: Boolean) -> Object ### Description Converts `Boolean` to `Object`. ## fn from(obj: Collator) -> Object ### Description Converts `Collator` to `Object`. ## fn from(obj: CollatorOptions) -> Object ### Description Converts `CollatorOptions` to `Object`. ## fn from(obj: DataView) -> Object ### Description Converts `DataView` to `Object`. ## fn from(obj: Date) -> Object ### Description Converts `Date` to `Object`. ## fn from(obj: DateTimeFormat) -> Object ### Description Converts `DateTimeFormat` to `Object`. ## fn from(obj: DateTimeFormatOptions) -> Object ### Description Converts `DateTimeFormatOptions` to `Object`. ## fn from(obj: DateTimeFormatPart) -> Object ### Description Converts `DateTimeFormatPart` to `Object`. ## fn from(obj: DisplayNames) -> Object ### Description Converts `DisplayNames` to `Object`. ## fn from(obj: DisplayNamesOptions) -> Object ### Description Converts `DisplayNamesOptions` to `Object`. ## fn from(obj: Duration) -> Object ### Description Converts `Duration` to `Object`. ``` -------------------------------- ### DataView::get_uint16 Source: https://docs.rs/js-sys/latest/js_sys/struct.DataView.html?search=std%3A%3Avec Gets an unsigned 16-bit integer (unsigned short) at the specified byte offset from the start of the view, using the platform's default endianness. ```APIDOC ## DataView::get_uint16 ### Description Gets an unsigned 16-bit integer (unsigned short) at the specified byte offset from the start of the view, using the platform's default endianness. ### Signature ```rust pub fn get_uint16(&self, byte_offset: usize) -> u16 ``` ### Parameters * `byte_offset`: The offset in bytes from the start of the `DataView`. ### Returns The unsigned 16-bit integer at the specified offset. ``` -------------------------------- ### Get 32-bit Float (Specified Endianness) Source: https://docs.rs/js-sys/latest/js_sys/struct.DataView.html?search=std%3A%3Avec Retrieves a signed 32-bit floating-point number at the specified byte offset from the start of the DataView, with explicit control over endianness. ```rust pub fn get_float32_endian(&self, byte_offset: usize, little_endian: bool) -> f32 ``` -------------------------------- ### instantiate_streaming Source: https://docs.rs/js-sys/latest/js_sys/WebAssembly/fn.instantiate_streaming.html?search=std%3A%3Avec The `WebAssembly.instantiateStreaming()` function compiles and instantiates a WebAssembly module directly from a streamed underlying source. This is the most efficient, optimized way to load Wasm code. ```APIDOC ## instantiate_streaming ### Description Compiles and instantiates a WebAssembly module directly from a streamed underlying source. This is the most efficient, optimized way to load Wasm code. ### Method Signature `pub fn instantiate_streaming(response: &JsValue, imports: &Object) -> Promise` ### Parameters * `response` (&JsValue) - The streamed response object. * `imports` (&Object) - An object containing the import functions for the WebAssembly module. ### Return Value A `Promise` that resolves with an object containing the instantiated module and its exports. ``` -------------------------------- ### ArrayTuple::get2 Source: https://docs.rs/js-sys/latest/src/js_sys/lib.rs.html?search=Option%3CT%3E%2C+%28T+-%3E+U%29+-%3E+Option%3CU%3E Gets the 3rd item from the ArrayTuple. This getter allows direct access to the third element. ```APIDOC ## ArrayTuple::get2 ### Description Gets the 3rd item from the ArrayTuple. ### Method `getter 2 (this: &ArrayTuple) -> ::T3` ### Parameters - **this** (ArrayTuple) - The ArrayTuple instance. ### Returns The third element of the ArrayTuple. ``` -------------------------------- ### from Source: https://docs.rs/js-sys/latest/js_sys/struct.Promise.html Creates a Promise from a given value. This is a standard conversion method. ```APIDOC ## fn from(t: T) -> T ### Description Returns the argument unchanged. ### Method `from` ### Parameters - `t` (T): The value to convert. ### Returns - `T`: The original value `t`. ``` -------------------------------- ### Get Signed 32-bit Integer (Specified Endianness) Source: https://docs.rs/js-sys/latest/js_sys/struct.DataView.html?search=std%3A%3Avec Retrieves a signed 32-bit integer (long) at the specified byte offset from the start of the DataView, with explicit control over endianness. ```rust pub fn get_int32_endian(&self, byte_offset: usize, little_endian: bool) -> i32 ``` -------------------------------- ### Get Element by Index (Typed, Deprecated) Source: https://docs.rs/js-sys/latest/src/js_sys/lib.rs.html?search=u32+-%3E+bool Retrieves an element from the Array by its index. Returns `None` if the index is out of range. This is a deprecated method for typed arrays. ```rust // Next major: deprecate /// Retrieves the element at the index (returns `None` if the index is out of range, ``` -------------------------------- ### WeakSet Search Examples Source: https://docs.rs/js-sys/latest/js_sys/struct.WeakSet.html?search= Demonstrates various ways to search within a WeakSet, including searching for specific types and patterns. ```APIDOC ## WeakSet Search ### Description Provides examples of how to search for elements within a WeakSet. ### Example Searches - `std::vec` - `u32 -> bool` - `Option, (T -> U) -> Option` ``` -------------------------------- ### Get Signed 16-bit Integer (Specified Endianness) Source: https://docs.rs/js-sys/latest/js_sys/struct.DataView.html?search=std%3A%3Avec Retrieves a signed 16-bit integer (short) at the specified byte offset from the start of the DataView, with explicit control over endianness. ```rust pub fn get_int16_endian(&self, byte_offset: usize, little_endian: bool) -> i16 ``` -------------------------------- ### compile Source: https://docs.rs/js-sys/latest/js_sys/WebAssembly/fn.compile.html?search=u32+-%3E+bool Compiles a WebAssembly.Module from WebAssembly binary code. ```APIDOC ## compile ### Description The `WebAssembly.compile()` function compiles a `WebAssembly.Module` from WebAssembly binary code. This function is useful if it is necessary to a compile a module before it can be instantiated (otherwise, the `WebAssembly.instantiate()` function should be used). ### Method `pub fn compile(buffer_source: &JsValue) -> Promise` ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body * **buffer_source** (JsValue) - Required - The WebAssembly binary code. ### Request Example None provided in source. ### Response #### Success Response * **Promise** - A Promise that resolves to a JsValue representing the compiled WebAssembly module. #### Response Example None provided in source. ``` -------------------------------- ### Get 32-bit Float (Default Endianness) Source: https://docs.rs/js-sys/latest/js_sys/struct.DataView.html?search=std%3A%3Avec Retrieves a signed 32-bit floating-point number at the specified byte offset from the start of the DataView, using the platform's default endianness. ```rust pub fn get_float32(&self, byte_offset: usize) -> f32 ``` -------------------------------- ### Module::new Source: https://docs.rs/js-sys/latest/js_sys/WebAssembly/struct.Module.html Creates a new `WebAssembly.Module` object from a given buffer source. This compiled module can be efficiently shared and instantiated multiple times. ```APIDOC ## Module::new ### Description Creates a new `WebAssembly.Module` object from a given buffer source. This compiled module can be efficiently shared and instantiated multiple times. ### Method `pub fn new(buffer_source: &JsValue) -> Result` ### Parameters #### Path Parameters - **buffer_source** (`&JsValue`) - Required - The source of the WebAssembly module, typically a buffer. ### Response #### Success Response - **Module** - A new `WebAssembly.Module` object. #### Error Response - **JsValue** - An error encountered during module compilation or loading. ``` -------------------------------- ### Get Unsigned 32-bit Integer (Specified Endianness) Source: https://docs.rs/js-sys/latest/js_sys/struct.DataView.html?search=std%3A%3Avec Retrieves an unsigned 32-bit integer (unsigned long) at the specified byte offset from the start of the DataView, with explicit control over endianness. ```rust pub fn get_uint32_endian(&self, byte_offset: usize, little_endian: bool) -> u32 ``` -------------------------------- ### Get Unsigned 16-bit Integer (Specified Endianness) Source: https://docs.rs/js-sys/latest/js_sys/struct.DataView.html?search=std%3A%3Avec Retrieves an unsigned 16-bit integer (unsigned short) at the specified byte offset from the start of the DataView, with explicit control over endianness. ```rust pub fn get_uint16_endian(&self, byte_offset: usize, little_endian: bool) -> u16 ``` -------------------------------- ### Example Searches for ResolvedDisplayNamesOptions Source: https://docs.rs/js-sys/latest/js_sys/Intl/struct.ResolvedDisplayNamesOptions.html?search= Demonstrates various ways to search for ResolvedDisplayNamesOptions, illustrating common patterns and types. ```APIDOC ## Example Searches This section provides examples of how to search for `Intl.ResolvedDisplayNamesOptions`. ### Query Examples - `std::vec` - `u32 -> bool` - `Option, (T -> U) -> Option` ``` -------------------------------- ### DataView::get_float16_as_f32 Source: https://docs.rs/js-sys/latest/js_sys/struct.DataView.html Gets a signed 16-bit float at the specified byte offset from the start of the DataView as an f32. The unsuffixed `get_float16` name is reserved for a future native `f16` binding. ```APIDOC ## DataView::get_float16_as_f32 ### Description Gets a signed 16-bit float at the specified byte offset from the start of the `DataView` as an `f32`. The unsuffixed `get_float16` name is reserved for a future native `f16` binding once Rust stabilizes the type. ### Method `DataView::get_float16_as_f32` ### Parameters - `byte_offset` (usize) - The byte offset from the start of the DataView. ### Returns `f32` - The signed 16-bit float value, converted to `f32`. ``` -------------------------------- ### Number Instance Methods Source: https://docs.rs/js-sys/latest/js_sys/struct.Number.html?search= Provides instance methods for formatting numbers into strings with language-sensitive representations, specific precision, fixed-point notation, or exponential notation. ```APIDOC ## Number Instance Methods ### to_locale_string Returns a string with a language sensitive representation of this number. - **Parameters** - `locale` (&str) - The locale to use for formatting. ### to_precision Returns a string representing the Number object to the specified precision. - **Parameters** - `precision` (u8) - The number of significant digits. ### to_fixed Returns a string representing the Number object using fixed-point notation. - **Parameters** - `digits` (u8) - The number of digits after the decimal point. ### to_exponential Returns a string representing the Number object in exponential notation. - **Parameters** - `fraction_digits` (u8) - The number of digits after the decimal point in the fractional part. ### to_string_with_radix Returns a string representing the specified Number object. - **Parameters** - `radix` (u8) - The base to use for the string representation. ### value_of Returns the wrapped primitive value of a Number object. ### pow Applies the binary `**` JS operator on the two `Number`s. - **Parameters** - `rhs` (&Self) - The right-hand side operand. ### unsigned_shr Applies the binary `>>>` JS operator on the two `Number`s. - **Parameters** - `rhs` (&Self) - The right-hand side operand. ``` -------------------------------- ### Instantiate WebAssembly Module Source: https://docs.rs/js-sys/latest/js_sys/WebAssembly/struct.Instance.html Synchronously instantiates a WebAssembly Module using provided module and import objects. The primary method for obtaining an Instance is typically asynchronous. ```rust pub fn new(module: &Module, imports: &Object) -> Result ``` -------------------------------- ### Get Signed 32-bit Integer (Default Endianness) Source: https://docs.rs/js-sys/latest/js_sys/struct.DataView.html?search=std%3A%3Avec Retrieves a signed 32-bit integer (long) at the specified byte offset from the start of the DataView, using the platform's default endianness. ```rust pub fn get_int32(&self, byte_offset: usize) -> i32 ``` -------------------------------- ### Get Signed 16-bit Integer (Default Endianness) Source: https://docs.rs/js-sys/latest/js_sys/struct.DataView.html?search=std%3A%3Avec Retrieves a signed 16-bit integer (short) at the specified byte offset from the start of the DataView, using the platform's default endianness. ```rust pub fn get_int16(&self, byte_offset: usize) -> i16 ``` -------------------------------- ### Default Implementation Source: https://docs.rs/js-sys/latest/js_sys/struct.Object.html?search=u32+-%3E+bool Allows creating a default Object instance. ```APIDOC ## impl Default for Object ### fn default() -> Self Returns the “default value” for a type. ``` -------------------------------- ### Get Unsigned 32-bit Integer (Default Endianness) Source: https://docs.rs/js-sys/latest/js_sys/struct.DataView.html?search=std%3A%3Avec Retrieves an unsigned 32-bit integer (unsigned long) at the specified byte offset from the start of the DataView, using the platform's default endianness. ```rust pub fn get_uint32(&self, byte_offset: usize) -> u32 ``` -------------------------------- ### js_sys::JsString::starts_with Source: https://docs.rs/js-sys/latest/js_sys/struct.Iterator.html?search=u32+-%3E+bool Determines whether a string begins with the specified prefix, optionally starting the search at a given position. ```APIDOC ## js_sys::JsString::starts_with ### Description Determines whether a string begins with the specified prefix, optionally starting the search at a given position. ### Method Instance method ### Parameters - **prefix** (&str): The string to search for at the beginning of this string. - **offset** (u32): The position in this string at which to begin searching for the `prefix`. Defaults to 0. ### Response #### Success Response - **bool**: Returns `true` if this string begins with the `prefix` at the specified `offset`, `false` otherwise. ### Response Example ```json true ``` ``` -------------------------------- ### compile Source: https://docs.rs/js-sys/latest/js_sys/WebAssembly/fn.compile.html?search=std%3A%3Avec Compiles a WebAssembly.Module from WebAssembly binary code. This function is useful if it is necessary to a compile a module before it can be instantiated (otherwise, the `WebAssembly.instantiate()` function should be used). ```APIDOC ## compile ### Description Compiles a `WebAssembly.Module` from WebAssembly binary code. This function is useful if it is necessary to compile a module before it can be instantiated (otherwise, the `WebAssembly.instantiate()` function should be used). ### Method `pub fn compile(buffer_source: &JsValue) -> Promise` ### Parameters #### Path Parameters - **buffer_source** (`&JsValue`) - Required - The WebAssembly binary code source. ### Return Type - **Promise** - A Promise that resolves to the compiled WebAssembly module. ``` -------------------------------- ### Get Unsigned 16-bit Integer (Default Endianness) Source: https://docs.rs/js-sys/latest/js_sys/struct.DataView.html?search=std%3A%3Avec Retrieves an unsigned 16-bit integer (unsigned short) at the specified byte offset from the start of the DataView, using the platform's default endianness. ```rust pub fn get_uint16(&self, byte_offset: usize) -> u16 ``` -------------------------------- ### compile Source: https://docs.rs/js-sys/latest/js_sys/WebAssembly/fn.compile.html?search=Option%3CT%3E%2C+%28T+-%3E+U%29+-%3E+Option%3CU%3E Compiles a WebAssembly.Module from WebAssembly binary code. This function is useful if it is necessary to a compile a module before it can be instantiated (otherwise, the `WebAssembly.instantiate()` function should be used). ```APIDOC ## compile ### Description Compiles a `WebAssembly.Module` from WebAssembly binary code. This function is useful if it is necessary to compile a module before it can be instantiated (otherwise, the `WebAssembly.instantiate()` function should be used). ### Method N/A (JavaScript Web API) ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example ```javascript // Assuming buffer_source is a WebAssembly binary buffer WebAssembly.compile(buffer_source).then(module => { // Module compiled successfully }); ``` ### Response #### Success Response - **Promise** - A Promise that resolves with the compiled `WebAssembly.Module`. #### Response Example ```json { "__proto__": "WebAssembly.Module" } ``` ``` -------------------------------- ### Get 32-bit float representation Source: https://docs.rs/js-sys/latest/js_sys/Math/fn.fround.html Use `fround` to convert a 64-bit float to its nearest 32-bit single precision float representation. This is useful when you need to work with single-precision floats, for example, for performance or compatibility reasons. ```rust pub fn fround(x: f64) -> f32 ``` -------------------------------- ### from Source: https://docs.rs/js-sys/latest/js_sys/struct.PromiseState.html?search=Option%3CT%3E%2C+%28T+-%3E+U%29+-%3E+Option%3CU%3E Creates a new instance from a given value. This is a standard conversion trait. ```APIDOC ## fn from(t: T) -> T ### Description Returns the argument unchanged. This is the core method for the `From` trait. ```