Skip to main content

Module str

Module str 

Source

Structsยง

ByteString
Encapsulates the IDL ByteString type.
CodeUnits
https://infra.spec.whatwg.org/#code-unit
DOMString
USVString
A string that is constructed from a UCS-2 buffer by replacing invalid code points with the replacement character.

Enumsยง

ConversionResult
A ad-hoc replacement for https://webidl.spec.whatwg.org/#idl-DOMString, used by component/script/dom/encoding.

Traitsยง

FromInputValueString ๐Ÿ”’
ToInputValueString ๐Ÿ”’

Functionsยง

is_leap_year ๐Ÿ”’
is_token
Returns whether s is a token, 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.
max_day_in_month ๐Ÿ”’
max_week_in_year ๐Ÿ”’
https://html.spec.whatwg.org/multipage/#week-number-of-the-last-day
parse_date_component ๐Ÿ”’
https://html.spec.whatwg.org/multipage/#parse-a-date-component
parse_month_component ๐Ÿ”’
https://html.spec.whatwg.org/multipage/#parse-a-month-component
parse_time_component ๐Ÿ”’
https://html.spec.whatwg.org/multipage/#parse-a-time-component
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