wasm-bindgen/api/js_sys/index.html

73 lines
17 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `js_sys` crate."><meta name="keywords" content="rust, rustlang, rust-lang, js_sys"><title>js_sys - Rust</title><link rel="stylesheet" type="text/css" href="../normalize.css"><link rel="stylesheet" type="text/css" href="../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../dark.css"><link rel="stylesheet" type="text/css" href="../light.css" id="themeStyle"><script src="../storage.js"></script><noscript><link rel="stylesheet" href="../noscript.css"></noscript><link rel="shortcut icon" href="../favicon.ico"><style type="text/css">#crate-search{background-image:url("../down-arrow.svg");}</style></head><body class="rustdoc mod"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">&#9776;</div><a href='../js_sys/index.html'><div class='logo-container'><img src='../rust-logo.png' alt='logo'></div></a><p class='location'>Crate js_sys</p><div class="sidebar-elems"><a id='all-types' href='all.html'><p>See all js_sys's items</p></a><div class="block items"><ul><li><a href="#modules">Modules</a></li><li><a href="#structs">Structs</a></li><li><a href="#functions">Functions</a></li></ul></div><p class='location'></p><script>window.sidebarCurrent = {name: 'js_sys', ty: 'mod', relpath: '../'};</script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press S to search, ? for more options…" type="search"></div><a id="settings-menu" href="../settings.html"><img src="../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class='fqn'><span class='out-of-band'><span id='render-detail'><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class='inner'>&#x2212;</span>]</a></span><a class='srclink' href='../src/js_sys/lib.rs.html#1-5035' title='goto source code'>[src]</a></span><span class='in-band'>Crate <a class="mod" href=''>js_sys</a></span></h1><div class='docblock'><p>Bindings to JavaScript's standard, built-in objects, including their methods
and properties.</p>
<p>This does <em>not</em> include any Web, Node, or any other JS environment
APIs. Only the things that are guaranteed to exist in the global scope by
the ECMAScript standard.</p>
<p>https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects</p>
<h2 id="a-note-about-camelcase-snake_case-and-naming-conventions" class="section-header"><a href="#a-note-about-camelcase-snake_case-and-naming-conventions">A Note About <code>camelCase</code>, <code>snake_case</code>, and Naming Conventions</a></h2>
<p>JavaScript's global objects use <code>camelCase</code> naming conventions for functions
and methods, but Rust style is to use <code>snake_case</code>. These bindings expose
the Rust style <code>snake_case</code> name. Additionally, acronyms within a method
name are all lower case, where as in JavaScript they are all upper case. For
example, <code>decodeURI</code> in JavaScript is exposed as <code>decode_uri</code> in these
bindings.</p>
</div><h2 id='modules' class='section-header'><a href="#modules">Modules</a></h2>
<table><tr class='module-item'><td><a class="mod" href="Atomics/index.html" title='js_sys::Atomics mod'>Atomics</a></td><td class='docblock-short'><p>The <code>Atomics</code> object provides atomic operations as static methods.
They are used with <code>SharedArrayBuffer</code> objects.</p>
</td></tr><tr class='module-item'><td><a class="mod" href="Intl/index.html" title='js_sys::Intl mod'>Intl</a></td><td class='docblock-short'></td></tr><tr class='module-item'><td><a class="mod" href="JSON/index.html" title='js_sys::JSON mod'>JSON</a></td><td class='docblock-short'><p>The <code>JSON</code> object contains methods for parsing <a href="https://json.org/">JavaScript Object
Notation (JSON)</a> and converting values to JSON. It
can't be called or constructed, and aside from its two method
properties, it has no interesting functionality of its own.</p>
</td></tr><tr class='module-item'><td><a class="mod" href="Math/index.html" title='js_sys::Math mod'>Math</a></td><td class='docblock-short'></td></tr><tr class='module-item'><td><a class="mod" href="Reflect/index.html" title='js_sys::Reflect mod'>Reflect</a></td><td class='docblock-short'></td></tr><tr class='module-item'><td><a class="mod" href="WebAssembly/index.html" title='js_sys::WebAssembly mod'>WebAssembly</a></td><td class='docblock-short'></td></tr></table><h2 id='structs' class='section-header'><a href="#structs">Structs</a></h2>
<table><tr class='module-item'><td><a class="struct" href="struct.Array.html" title='js_sys::Array struct'>Array</a></td><td class='docblock-short'></td></tr><tr class='module-item'><td><a class="struct" href="struct.ArrayBuffer.html" title='js_sys::ArrayBuffer struct'>ArrayBuffer</a></td><td class='docblock-short'></td></tr><tr class='module-item'><td><a class="struct" href="struct.ArrayIter.html" title='js_sys::ArrayIter struct'>ArrayIter</a></td><td class='docblock-short'><p>Iterator returned by <code>Array::iter</code></p>
</td></tr><tr class='module-item'><td><a class="struct" href="struct.AsyncIterator.html" title='js_sys::AsyncIterator struct'>AsyncIterator</a></td><td class='docblock-short'><p>Any object that conforms to the JS async iterator protocol. For example,
something returned by <code>myObject[Symbol.asyncIterator]()</code>.</p>
</td></tr><tr class='module-item'><td><a class="struct" href="struct.Boolean.html" title='js_sys::Boolean struct'>Boolean</a></td><td class='docblock-short'></td></tr><tr class='module-item'><td><a class="struct" href="struct.DataView.html" title='js_sys::DataView struct'>DataView</a></td><td class='docblock-short'></td></tr><tr class='module-item'><td><a class="struct" href="struct.Date.html" title='js_sys::Date struct'>Date</a></td><td class='docblock-short'></td></tr><tr class='module-item'><td><a class="struct" href="struct.Error.html" title='js_sys::Error struct'>Error</a></td><td class='docblock-short'></td></tr><tr class='module-item'><td><a class="struct" href="struct.EvalError.html" title='js_sys::EvalError struct'>EvalError</a></td><td class='docblock-short'></td></tr><tr class='module-item'><td><a class="struct" href="struct.Float32Array.html" title='js_sys::Float32Array struct'>Float32Array</a></td><td class='docblock-short'></td></tr><tr class='module-item'><td><a class="struct" href="struct.Float64Array.html" title='js_sys::Float64Array struct'>Float64Array</a></td><td class='docblock-short'></td></tr><tr class='module-item'><td><a class="struct" href="struct.Function.html" title='js_sys::Function struct'>Function</a></td><td class='docblock-short'></td></tr><tr class='module-item'><td><a class="struct" href="struct.Generator.html" title='js_sys::Generator struct'>Generator</a></td><td class='docblock-short'></td></tr><tr class='module-item'><td><a class="struct" href="struct.Int8Array.html" title='js_sys::Int8Array struct'>Int8Array</a></td><td class='docblock-short'></td></tr><tr class='module-item'><td><a class="struct" href="struct.Int16Array.html" title='js_sys::Int16Array struct'>Int16Array</a></td><td class='docblock-short'></td></tr><tr class='module-item'><td><a class="struct" href="struct.Int32Array.html" title='js_sys::Int32Array struct'>Int32Array</a></td><td class='docblock-short'></td></tr><tr class='module-item'><td><a class="struct" href="struct.IntoIter.html" title='js_sys::IntoIter struct'>IntoIter</a></td><td class='docblock-short'><p>An iterator over the JS <code>Symbol.iterator</code> iteration protocol.</p>
</td></tr><tr class='module-item'><td><a class="struct" href="struct.Iter.html" title='js_sys::Iter struct'>Iter</a></td><td class='docblock-short'><p>An iterator over the JS <code>Symbol.iterator</code> iteration protocol.</p>
</td></tr><tr class='module-item'><td><a class="struct" href="struct.Iterator.html" title='js_sys::Iterator struct'>Iterator</a></td><td class='docblock-short'><p>Any object that conforms to the JS iterator protocol. For example,
something returned by <code>myArray[Symbol.iterator]()</code>.</p>
</td></tr><tr class='module-item'><td><a class="struct" href="struct.IteratorNext.html" title='js_sys::IteratorNext struct'>IteratorNext</a></td><td class='docblock-short'><p>The result of calling <code>next()</code> on a JS iterator.</p>
</td></tr><tr class='module-item'><td><a class="struct" href="struct.JsString.html" title='js_sys::JsString struct'>JsString</a></td><td class='docblock-short'></td></tr><tr class='module-item'><td><a class="struct" href="struct.Map.html" title='js_sys::Map struct'>Map</a></td><td class='docblock-short'></td></tr><tr class='module-item'><td><a class="struct" href="struct.Number.html" title='js_sys::Number struct'>Number</a></td><td class='docblock-short'></td></tr><tr class='module-item'><td><a class="struct" href="struct.Object.html" title='js_sys::Object struct'>Object</a></td><td class='docblock-short'></td></tr><tr class='module-item'><td><a class="struct" href="struct.Promise.html" title='js_sys::Promise struct'>Promise</a></td><td class='docblock-short'><p>The <code>Promise</code> object represents the eventual completion (or failure) of
an asynchronous operation, and its resulting value.</p>
</td></tr><tr class='module-item'><td><a class="struct" href="struct.Proxy.html" title='js_sys::Proxy struct'>Proxy</a></td><td class='docblock-short'></td></tr><tr class='module-item'><td><a class="struct" href="struct.RangeError.html" title='js_sys::RangeError struct'>RangeError</a></td><td class='docblock-short'><p>The <code>RangeError</code> object indicates an error when a value is not in the set
or range of allowed values.</p>
</td></tr><tr class='module-item'><td><a class="struct" href="struct.ReferenceError.html" title='js_sys::ReferenceError struct'>ReferenceError</a></td><td class='docblock-short'><p>The <code>ReferenceError</code> object represents an error when a non-existent
variable is referenced.</p>
</td></tr><tr class='module-item'><td><a class="struct" href="struct.RegExp.html" title='js_sys::RegExp struct'>RegExp</a></td><td class='docblock-short'></td></tr><tr class='module-item'><td><a class="struct" href="struct.Set.html" title='js_sys::Set struct'>Set</a></td><td class='docblock-short'></td></tr><tr class='module-item'><td><a class="struct" href="struct.SharedArrayBuffer.html" title='js_sys::SharedArrayBuffer struct'>SharedArrayBuffer</a></td><td class='docblock-short'></td></tr><tr class='module-item'><td><a class="struct" href="struct.Symbol.html" title='js_sys::Symbol struct'>Symbol</a></td><td class='docblock-short'></td></tr><tr class='module-item'><td><a class="struct" href="struct.SyntaxError.html" title='js_sys::SyntaxError struct'>SyntaxError</a></td><td class='docblock-short'><p>A <code>SyntaxError</code> is thrown when the JavaScript engine encounters tokens or
token order that does not conform to the syntax of the language when
parsing code.</p>
</td></tr><tr class='module-item'><td><a class="struct" href="struct.TypeError.html" title='js_sys::TypeError struct'>TypeError</a></td><td class='docblock-short'><p>The <code>TypeError</code> object represents an error when a value is not of the
expected type.</p>
</td></tr><tr class='module-item'><td><a class="struct" href="struct.Uint8Array.html" title='js_sys::Uint8Array struct'>Uint8Array</a></td><td class='docblock-short'></td></tr><tr class='module-item'><td><a class="struct" href="struct.Uint8ClampedArray.html" title='js_sys::Uint8ClampedArray struct'>Uint8ClampedArray</a></td><td class='docblock-short'></td></tr><tr class='module-item'><td><a class="struct" href="struct.Uint16Array.html" title='js_sys::Uint16Array struct'>Uint16Array</a></td><td class='docblock-short'></td></tr><tr class='module-item'><td><a class="struct" href="struct.Uint32Array.html" title='js_sys::Uint32Array struct'>Uint32Array</a></td><td class='docblock-short'></td></tr><tr class='module-item'><td><a class="struct" href="struct.UriError.html" title='js_sys::UriError struct'>UriError</a></td><td class='docblock-short'><p>The <code>URIError</code> object represents an error when a global URI handling
function was used in a wrong way.</p>
</td></tr><tr class='module-item'><td><a class="struct" href="struct.WeakMap.html" title='js_sys::WeakMap struct'>WeakMap</a></td><td class='docblock-short'></td></tr><tr class='module-item'><td><a class="struct" href="struct.WeakSet.html" title='js_sys::WeakSet struct'>WeakSet</a></td><td class='docblock-short'></td></tr></table><h2 id='functions' class='section-header'><a href="#functions">Functions</a></h2>
<table><tr class='module-item'><td><a class="fn" href="fn.decode_uri.html" title='js_sys::decode_uri fn'>decode_uri</a></td><td class='docblock-short'><p>The <code>decodeURI()</code> function decodes a Uniform Resource Identifier (URI)
previously created by <code>encodeURI</code> or by a similar routine.</p>
</td></tr><tr class='module-item'><td><a class="fn" href="fn.decode_uri_component.html" title='js_sys::decode_uri_component fn'>decode_uri_component</a></td><td class='docblock-short'><p>The <code>decodeURIComponent()</code> function decodes a Uniform Resource Identifier (URI) component
previously created by <code>encodeURIComponent</code> or by a similar routine.</p>
</td></tr><tr class='module-item'><td><a class="fn" href="fn.encode_uri.html" title='js_sys::encode_uri fn'>encode_uri</a></td><td class='docblock-short'><p>The <code>encodeURI()</code> function encodes a Uniform Resource Identifier (URI)
by replacing each instance of certain characters by one, two, three, or
four escape sequences representing the UTF-8 encoding of the character
(will only be four escape sequences for characters composed of two
&quot;surrogate&quot; characters).</p>
</td></tr><tr class='module-item'><td><a class="fn" href="fn.encode_uri_component.html" title='js_sys::encode_uri_component fn'>encode_uri_component</a></td><td class='docblock-short'><p>The <code>encodeURIComponent()</code> function encodes a Uniform Resource Identifier (URI) component
by replacing each instance of certain characters by one, two, three, or four escape sequences
representing the UTF-8 encoding of the character
(will only be four escape sequences for characters composed of two &quot;surrogate&quot; characters).</p>
</td></tr><tr class='module-item'><td><a class="fn" href="fn.escape.html" title='js_sys::escape fn'>escape</a></td><td class='docblock-short'><p>The <code>escape()</code> function computes a new string in which certain characters have been
replaced by a hexadecimal escape sequence.</p>
</td></tr><tr class='module-item'><td><a class="fn" href="fn.eval.html" title='js_sys::eval fn'>eval</a></td><td class='docblock-short'><p>The <code>eval()</code> function evaluates JavaScript code represented as a string.</p>
</td></tr><tr class='module-item'><td><a class="fn" href="fn.global.html" title='js_sys::global fn'>global</a></td><td class='docblock-short'><p>Returns a handle to the global scope object.</p>
</td></tr><tr class='module-item'><td><a class="fn" href="fn.is_finite.html" title='js_sys::is_finite fn'>is_finite</a></td><td class='docblock-short'><p>The global <code>isFinite()</code> function determines whether the passed value is a finite number.
If needed, the parameter is first converted to a number.</p>
</td></tr><tr class='module-item'><td><a class="fn" href="fn.parse_float.html" title='js_sys::parse_float fn'>parse_float</a></td><td class='docblock-short'><p>The <code>parseFloat()</code> function parses an argument and returns a floating point number,
or NaN on error.</p>
</td></tr><tr class='module-item'><td><a class="fn" href="fn.parse_int.html" title='js_sys::parse_int fn'>parse_int</a></td><td class='docblock-short'><p>The <code>parseInt()</code> function parses a string argument and returns an integer
of the specified radix (the base in mathematical numeral systems), or NaN on error.</p>
</td></tr><tr class='module-item'><td><a class="fn" href="fn.try_iter.html" title='js_sys::try_iter fn'>try_iter</a></td><td class='docblock-short'><p>Create an iterator over <code>val</code> using the JS iteration protocol and
<code>Symbol.iterator</code>.</p>
</td></tr><tr class='module-item'><td><a class="fn" href="fn.unescape.html" title='js_sys::unescape fn'>unescape</a></td><td class='docblock-short'><p>The <code>unescape()</code> function computes a new string in which hexadecimal escape
sequences are replaced with the character that it represents. The escape sequences might
be introduced by a function like <code>escape</code>. Usually, <code>decodeURI</code> or <code>decodeURIComponent</code>
are preferred over <code>unescape</code>.</p>
</td></tr></table></section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../";window.currentCrate = "js_sys";</script><script src="../main.js"></script><script defer src="../search-index.js"></script></body></html>