Struct rusty_v8::String [−][src]
#[repr(C)]pub struct String(_);
Expand description
A JavaScript string value (ECMA-262, 4.3.17).
Implementations
pub fn new_from_utf8<'s>(
scope: &mut HandleScope<'s, ()>,
buffer: &[u8],
new_type: NewStringType
) -> Option<Local<'s, String>>
[src]
pub fn new_from_utf8<'s>(
scope: &mut HandleScope<'s, ()>,
buffer: &[u8],
new_type: NewStringType
) -> Option<Local<'s, String>>
[src]Allocates a new string from UTF-8 data. Only returns an empty value when length > kMaxLength
pub fn new_from_one_byte<'s>(
scope: &mut HandleScope<'s, ()>,
buffer: &[u8],
new_type: NewStringType
) -> Option<Local<'s, String>>
[src]
pub fn new_from_one_byte<'s>(
scope: &mut HandleScope<'s, ()>,
buffer: &[u8],
new_type: NewStringType
) -> Option<Local<'s, String>>
[src]Allocates a new string from Latin-1 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.
pub fn write_utf8(
&self,
scope: &mut Isolate,
buffer: &mut [u8],
nchars_ref: Option<&mut usize>,
options: WriteOptions
) -> usize
[src]pub fn new_external_onebyte_static<'s>(
scope: &mut HandleScope<'s, ()>,
buffer: &'static [u8]
) -> Option<Local<'s, String>>
[src]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 NOTE: can’t yet be created via rusty_v8
True if string is known to contain only one-byte data doesn’t read the string so can return false positives
Convenience function not present in the original V8 API.
Methods from Deref<Target = Value>
Returns true if this value is the undefined value. See ECMA-262 4.3.10.
Returns true if this value is the null value. See ECMA-262 4.3.11.
Returns true if this value is either the null or the undefined value. See ECMA-262 4.3.11. and 4.3.12
Returns true if this value is true.
This is not the same as BooleanValue()
. The latter performs a
conversion to boolean, i.e. the result of Boolean(value)
in JS, whereas
this checks value === true
.
Returns true if this value is false.
This is not the same as !BooleanValue()
. The latter performs a
conversion to boolean, i.e. the result of !Boolean(value)
in JS, whereas
this checks value === false
.
Returns true if this value is a symbol or a string.
This is equivalent to
typeof value === 'string' || typeof value === 'symbol'
in JS.
Returns true if this value is an instance of the String type. See ECMA-262 8.4.
Returns true if this value is a symbol.
This is equivalent to typeof value === 'symbol'
in JS.
Returns true if this value is a function.
Returns true if this value is an array. Note that it will return false for an Proxy for an array.
Returns true if this value is a bigint.
This is equivalent to typeof value === 'bigint'
in JS.
Returns true if this value is boolean.
This is equivalent to typeof value === 'boolean'
in JS.
Returns true if this value is an External
object.
Returns true if this value is an Arguments object.
Returns true if this value is a BigInt object.
Returns true if this value is a Boolean object.
Returns true if this value is a Number object.
Returns true if this value is a String object.
Returns true if this value is a Symbol object.
Returns true if this value is a NativeError.
Returns true if this value is a RegExp.
Returns true if this value is an async function.
Returns true if this value is a Generator function.
Returns true if this value is a Promise.
Returns true if this value is a Map Iterator.
Returns true if this value is a Set Iterator.
Returns true if this value is a WeakMap.
Returns true if this value is a WeakSet.
Returns true if this value is an ArrayBuffer.
Returns true if this value is an ArrayBufferView.
Returns true if this value is one of TypedArrays.
Returns true if this value is an Uint8Array.
Returns true if this value is an Uint8ClampedArray.
Returns true if this value is an Int8Array.
Returns true if this value is an Uint16Array.
Returns true if this value is an Int16Array.
Returns true if this value is an Uint32Array.
Returns true if this value is an Int32Array.
Returns true if this value is a Float32Array.
Returns true if this value is a Float64Array.
Returns true if this value is a BigInt64Array.
Returns true if this value is a BigUint64Array.
Returns true if this value is a DataView.
Returns true if this value is a SharedArrayBuffer. This is an experimental feature.
Returns true if this value is a WasmModuleObject.
Returns true if the value is a Module Namespace Object.
Implements the the abstract operation SameValueZero
, which is defined in
ECMA-262 6th edition § 7.2.10
(http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero).
This operation is used to compare values for the purpose of insertion into
a Set
, or determining whether Map
keys are equivalent. Its semantics
are almost the same as strict_equals()
and same_value()
, with the
following important distinctions:
- It considers
NaN
equal toNaN
(unlikestrict_equals()
). - It considers
-0
equal to0
(unlikesame_value()
).
Convenience function not present in the original V8 API.
Perform the equivalent of Boolean(value) in JS. This can never fail.
Methods from Deref<Target = Data>
Returns the V8 hash value for this value. The current implementation uses a hidden property to store the identity hash on some object types.
The return value will never be 0. Also, it is not guaranteed to be unique.
Returns true if this data is a Private
.
Returns true if this data is an ObjectTemplate
Returns true if this data is a FunctionTemplate.
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for String
impl UnwindSafe for String