Expand description
The ByteString struct.
Re-exports§
pub use crate::domstring::DOMString;
Structs§
- Byte
String - Encapsulates the IDL
ByteStringtype. - Code
Units - https://infra.spec.whatwg.org/#code-unit
- USVString
- A string that is constructed from a UCS-2 buffer by replacing invalid code points with the replacement character.
Enums§
- Conversion
Result - A ad-hoc replacement for https://webidl.spec.whatwg.org/#idl-DOMString,
used by
component/script/dom/encoding.
Functions§
- has_
latin1_ 🔒chars - is_
token - Returns whether
sis atoken, as defined by RFC 2616. - js_
string_ to_ code_ units - https://webidl.spec.whatwg.org/#js-DOMString Implements the js to DOMstring conversion, but using an ad-hoc data structure, because current DOMString implementation does not preserve the exact sequence of code units.
- serialize_
jsval_ to_ json_ utf8 - Because this converts to a DOMString it becomes UTF-8 encoded which is closer to the spec definition of https://infra.spec.whatwg.org/#serialize-a-javascript-value-to-json-bytes but we generally do not operate on anything that is truly a WTF-16 string.
- to_
js_ string - Safe wrapper around https://tc39.es/ecma262/multipage/abstract-operations.html#sec-tostring