Struct rusty_v8::String[][src]

#[repr(C)]
pub struct String(_);
Expand description

A JavaScript string value (ECMA-262, 4.3.17).

Implementations

Allocates a new string from UTF-8 data. Only returns an empty value when length > kMaxLength

Allocates a new string from Latin-1 data. Only returns an empty value when length > kMaxLength.

Allocates a new string from UTF-16 data. Only returns an empty value when length > kMaxLength.

Returns the number of characters (UTF-16 code units) in this string.

Returns the number of bytes in the UTF-8 encoded representation of this string.

Writes the contents of the string to an external buffer, as 16-bit (UTF-16) character codes.

Writes the contents of the string to an external buffer, as one-byte (Latin-1) characters.

Writes the contents of the string to an external buffer, as UTF-8.

True if string is external

True if string is external & one-byte (e.g: created with new_external_onebyte_static)

True if string is external & two-byte (e.g: created with new_external_twobyte_static)

True if string is known to contain only one-byte data. Doesn’t read the string so can return false positives.

For a method that will not return false positives at the cost of potentially reading the entire string, use contains_only_onebyte().

True if the string contains only one-byte data. Will read the entire string in some cases.

Convenience function not present in the original V8 API.

Trait Implementations

Formats the value using the given formatter. Read more

The resulting type after dereferencing.

Dereferences the value.

Feeds this value into the given Hasher. Read more

Feeds a slice of this type into the given Hasher. Read more

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.