#[repr(C)]pub struct Value(_);
Expand description
The superclass of all JavaScript values and objects.
Implementations§
source§impl Value
impl Value
sourcepub fn is_undefined(&self) -> bool
pub fn is_undefined(&self) -> bool
Returns true if this value is the undefined value. See ECMA-262 4.3.10.
sourcepub fn is_null(&self) -> bool
pub fn is_null(&self) -> bool
Returns true if this value is the null value. See ECMA-262 4.3.11.
sourcepub fn is_null_or_undefined(&self) -> bool
pub fn is_null_or_undefined(&self) -> bool
Returns true if this value is either the null or the undefined value. See ECMA-262 4.3.11. and 4.3.12
sourcepub fn is_true(&self) -> bool
pub fn is_true(&self) -> bool
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
.
sourcepub fn is_false(&self) -> bool
pub fn is_false(&self) -> bool
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
.
sourcepub fn is_name(&self) -> bool
pub fn is_name(&self) -> bool
Returns true if this value is a symbol or a string.
This is equivalent to
typeof value === 'string' || typeof value === 'symbol'
in JS.
sourcepub fn is_string(&self) -> bool
pub fn is_string(&self) -> bool
Returns true if this value is an instance of the String type. See ECMA-262 8.4.
sourcepub fn is_symbol(&self) -> bool
pub fn is_symbol(&self) -> bool
Returns true if this value is a symbol.
This is equivalent to typeof value === 'symbol'
in JS.
sourcepub fn is_function(&self) -> bool
pub fn is_function(&self) -> bool
Returns true if this value is a function.
sourcepub fn is_array(&self) -> bool
pub fn is_array(&self) -> bool
Returns true if this value is an array. Note that it will return false for an Proxy for an array.
sourcepub fn is_big_int(&self) -> bool
pub fn is_big_int(&self) -> bool
Returns true if this value is a bigint.
This is equivalent to typeof value === 'bigint'
in JS.
sourcepub fn is_boolean(&self) -> bool
pub fn is_boolean(&self) -> bool
Returns true if this value is boolean.
This is equivalent to typeof value === 'boolean'
in JS.
sourcepub fn is_external(&self) -> bool
pub fn is_external(&self) -> bool
Returns true if this value is an External
object.
sourcepub fn is_arguments_object(&self) -> bool
pub fn is_arguments_object(&self) -> bool
Returns true if this value is an Arguments object.
sourcepub fn is_big_int_object(&self) -> bool
pub fn is_big_int_object(&self) -> bool
Returns true if this value is a BigInt object.
sourcepub fn is_boolean_object(&self) -> bool
pub fn is_boolean_object(&self) -> bool
Returns true if this value is a Boolean object.
sourcepub fn is_number_object(&self) -> bool
pub fn is_number_object(&self) -> bool
Returns true if this value is a Number object.
sourcepub fn is_string_object(&self) -> bool
pub fn is_string_object(&self) -> bool
Returns true if this value is a String object.
sourcepub fn is_symbol_object(&self) -> bool
pub fn is_symbol_object(&self) -> bool
Returns true if this value is a Symbol object.
sourcepub fn is_native_error(&self) -> bool
pub fn is_native_error(&self) -> bool
Returns true if this value is a NativeError.
sourcepub fn is_reg_exp(&self) -> bool
pub fn is_reg_exp(&self) -> bool
Returns true if this value is a RegExp.
sourcepub fn is_async_function(&self) -> bool
pub fn is_async_function(&self) -> bool
Returns true if this value is an async function.
sourcepub fn is_generator_function(&self) -> bool
pub fn is_generator_function(&self) -> bool
Returns true if this value is a Generator function.
sourcepub fn is_promise(&self) -> bool
pub fn is_promise(&self) -> bool
Returns true if this value is a Promise.
sourcepub fn is_map_iterator(&self) -> bool
pub fn is_map_iterator(&self) -> bool
Returns true if this value is a Map Iterator.
sourcepub fn is_set_iterator(&self) -> bool
pub fn is_set_iterator(&self) -> bool
Returns true if this value is a Set Iterator.
sourcepub fn is_weak_map(&self) -> bool
pub fn is_weak_map(&self) -> bool
Returns true if this value is a WeakMap.
sourcepub fn is_weak_set(&self) -> bool
pub fn is_weak_set(&self) -> bool
Returns true if this value is a WeakSet.
sourcepub fn is_array_buffer(&self) -> bool
pub fn is_array_buffer(&self) -> bool
Returns true if this value is an ArrayBuffer.
sourcepub fn is_array_buffer_view(&self) -> bool
pub fn is_array_buffer_view(&self) -> bool
Returns true if this value is an ArrayBufferView.
sourcepub fn is_typed_array(&self) -> bool
pub fn is_typed_array(&self) -> bool
Returns true if this value is one of TypedArrays.
sourcepub fn is_uint8_array(&self) -> bool
pub fn is_uint8_array(&self) -> bool
Returns true if this value is an Uint8Array.
sourcepub fn is_uint8_clamped_array(&self) -> bool
pub fn is_uint8_clamped_array(&self) -> bool
Returns true if this value is an Uint8ClampedArray.
sourcepub fn is_int8_array(&self) -> bool
pub fn is_int8_array(&self) -> bool
Returns true if this value is an Int8Array.
sourcepub fn is_uint16_array(&self) -> bool
pub fn is_uint16_array(&self) -> bool
Returns true if this value is an Uint16Array.
sourcepub fn is_int16_array(&self) -> bool
pub fn is_int16_array(&self) -> bool
Returns true if this value is an Int16Array.
sourcepub fn is_uint32_array(&self) -> bool
pub fn is_uint32_array(&self) -> bool
Returns true if this value is an Uint32Array.
sourcepub fn is_int32_array(&self) -> bool
pub fn is_int32_array(&self) -> bool
Returns true if this value is an Int32Array.
sourcepub fn is_float32_array(&self) -> bool
pub fn is_float32_array(&self) -> bool
Returns true if this value is a Float32Array.
sourcepub fn is_float64_array(&self) -> bool
pub fn is_float64_array(&self) -> bool
Returns true if this value is a Float64Array.
sourcepub fn is_big_int64_array(&self) -> bool
pub fn is_big_int64_array(&self) -> bool
Returns true if this value is a BigInt64Array.
sourcepub fn is_big_uint64_array(&self) -> bool
pub fn is_big_uint64_array(&self) -> bool
Returns true if this value is a BigUint64Array.
sourcepub fn is_data_view(&self) -> bool
pub fn is_data_view(&self) -> bool
Returns true if this value is a DataView.
Returns true if this value is a SharedArrayBuffer. This is an experimental feature.
sourcepub fn is_wasm_memory_object(&self) -> bool
pub fn is_wasm_memory_object(&self) -> bool
Returns true if this value is a WasmMemoryObject.
sourcepub fn is_wasm_module_object(&self) -> bool
pub fn is_wasm_module_object(&self) -> bool
Returns true if this value is a WasmModuleObject.
sourcepub fn is_module_namespace_object(&self) -> bool
pub fn is_module_namespace_object(&self) -> bool
Returns true if the value is a Module Namespace Object.
pub fn strict_equals(&self, that: Local<'_, Value>) -> bool
pub fn same_value(&self, that: Local<'_, Value>) -> bool
sourcepub fn same_value_zero(&self, that: Local<'_, Value>) -> bool
pub fn same_value_zero(&self, that: Local<'_, Value>) -> bool
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()
).
pub fn to_big_int<'s>(
&self,
scope: &mut HandleScope<'s>
) -> Option<Local<'s, BigInt>>
pub fn to_number<'s>(
&self,
scope: &mut HandleScope<'s>
) -> Option<Local<'s, Number>>
pub fn to_string<'s>(
&self,
scope: &mut HandleScope<'s>
) -> Option<Local<'s, String>>
sourcepub fn to_rust_string_lossy<'s>(&self, scope: &mut HandleScope<'s>) -> String
pub fn to_rust_string_lossy<'s>(&self, scope: &mut HandleScope<'s>) -> String
Convenience function not present in the original V8 API.
pub fn to_detail_string<'s>(
&self,
scope: &mut HandleScope<'s>
) -> Option<Local<'s, String>>
pub fn to_object<'s>(
&self,
scope: &mut HandleScope<'s>
) -> Option<Local<'s, Object>>
pub fn to_integer<'s>(
&self,
scope: &mut HandleScope<'s>
) -> Option<Local<'s, Integer>>
pub fn to_uint32<'s>(
&self,
scope: &mut HandleScope<'s>
) -> Option<Local<'s, Uint32>>
pub fn to_int32<'s>(
&self,
scope: &mut HandleScope<'s>
) -> Option<Local<'s, Int32>>
sourcepub fn to_boolean<'s>(
&self,
scope: &mut HandleScope<'s, ()>
) -> Local<'s, Boolean>
pub fn to_boolean<'s>(
&self,
scope: &mut HandleScope<'s, ()>
) -> Local<'s, Boolean>
Perform the equivalent of Boolean(value) in JS. This can never fail.
pub fn instance_of<'s>(
&self,
scope: &mut HandleScope<'s>,
object: Local<'_, Object>
) -> Option<bool>
pub fn number_value<'s>(&self, scope: &mut HandleScope<'s>) -> Option<f64>
pub fn integer_value<'s>(&self, scope: &mut HandleScope<'s>) -> Option<i64>
pub fn uint32_value<'s>(&self, scope: &mut HandleScope<'s>) -> Option<u32>
pub fn int32_value<'s>(&self, scope: &mut HandleScope<'s>) -> Option<i32>
pub fn boolean_value<'s>(&self, scope: &mut HandleScope<'s, ()>) -> bool
sourcepub fn get_hash(&self) -> NonZeroI32
pub fn get_hash(&self) -> NonZeroI32
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.
Methods from Deref<Target = Data>§
sourcepub fn is_big_int(&self) -> bool
pub fn is_big_int(&self) -> bool
Returns true if this data is a BigInt
.
sourcepub fn is_boolean(&self) -> bool
pub fn is_boolean(&self) -> bool
Returns true if this data is a Boolean
.
sourcepub fn is_context(&self) -> bool
pub fn is_context(&self) -> bool
Returns true if this data is a Context
.
sourcepub fn is_fixed_array(&self) -> bool
pub fn is_fixed_array(&self) -> bool
Returns true if this data is a FixedArray
.
sourcepub fn is_function_template(&self) -> bool
pub fn is_function_template(&self) -> bool
Returns true if this data is a FunctionTemplate
.
sourcepub fn is_module_request(&self) -> bool
pub fn is_module_request(&self) -> bool
Returns true if this data is a ModuleRequest
.
sourcepub fn is_object_template(&self) -> bool
pub fn is_object_template(&self) -> bool
Returns true if this data is a ObjectTemplate
.
sourcepub fn is_primitive(&self) -> bool
pub fn is_primitive(&self) -> bool
Returns true if this data is a Primitive
.
sourcepub fn is_private(&self) -> bool
pub fn is_private(&self) -> bool
Returns true if this data is a Private
.
Trait Implementations§
source§impl<'s> PartialEq<Array> for Value
impl<'s> PartialEq<Array> for Value
source§impl<'s> PartialEq<ArrayBuffer> for Value
impl<'s> PartialEq<ArrayBuffer> for Value
source§fn eq(&self, other: &ArrayBuffer) -> bool
fn eq(&self, other: &ArrayBuffer) -> bool
self
and other
values to be equal, and is used
by ==
.source§impl<'s> PartialEq<ArrayBufferView> for Value
impl<'s> PartialEq<ArrayBufferView> for Value
source§fn eq(&self, other: &ArrayBufferView) -> bool
fn eq(&self, other: &ArrayBufferView) -> bool
self
and other
values to be equal, and is used
by ==
.source§impl<'s> PartialEq<BigInt> for Value
impl<'s> PartialEq<BigInt> for Value
source§impl<'s> PartialEq<BigInt64Array> for Value
impl<'s> PartialEq<BigInt64Array> for Value
source§fn eq(&self, other: &BigInt64Array) -> bool
fn eq(&self, other: &BigInt64Array) -> bool
self
and other
values to be equal, and is used
by ==
.source§impl<'s> PartialEq<BigIntObject> for Value
impl<'s> PartialEq<BigIntObject> for Value
source§fn eq(&self, other: &BigIntObject) -> bool
fn eq(&self, other: &BigIntObject) -> bool
self
and other
values to be equal, and is used
by ==
.source§impl<'s> PartialEq<BigUint64Array> for Value
impl<'s> PartialEq<BigUint64Array> for Value
source§fn eq(&self, other: &BigUint64Array) -> bool
fn eq(&self, other: &BigUint64Array) -> bool
self
and other
values to be equal, and is used
by ==
.source§impl<'s> PartialEq<Boolean> for Value
impl<'s> PartialEq<Boolean> for Value
source§impl<'s> PartialEq<BooleanObject> for Value
impl<'s> PartialEq<BooleanObject> for Value
source§fn eq(&self, other: &BooleanObject) -> bool
fn eq(&self, other: &BooleanObject) -> bool
self
and other
values to be equal, and is used
by ==
.source§impl<'s> PartialEq<DataView> for Value
impl<'s> PartialEq<DataView> for Value
source§impl<'s> PartialEq<Date> for Value
impl<'s> PartialEq<Date> for Value
source§impl<'s> PartialEq<External> for Value
impl<'s> PartialEq<External> for Value
source§impl<'s> PartialEq<Float32Array> for Value
impl<'s> PartialEq<Float32Array> for Value
source§fn eq(&self, other: &Float32Array) -> bool
fn eq(&self, other: &Float32Array) -> bool
self
and other
values to be equal, and is used
by ==
.source§impl<'s> PartialEq<Float64Array> for Value
impl<'s> PartialEq<Float64Array> for Value
source§fn eq(&self, other: &Float64Array) -> bool
fn eq(&self, other: &Float64Array) -> bool
self
and other
values to be equal, and is used
by ==
.source§impl<'s> PartialEq<Function> for Value
impl<'s> PartialEq<Function> for Value
source§impl<'s> PartialEq<Int16Array> for Value
impl<'s> PartialEq<Int16Array> for Value
source§fn eq(&self, other: &Int16Array) -> bool
fn eq(&self, other: &Int16Array) -> bool
self
and other
values to be equal, and is used
by ==
.source§impl<'s> PartialEq<Int32> for Value
impl<'s> PartialEq<Int32> for Value
source§impl<'s> PartialEq<Int32Array> for Value
impl<'s> PartialEq<Int32Array> for Value
source§fn eq(&self, other: &Int32Array) -> bool
fn eq(&self, other: &Int32Array) -> bool
self
and other
values to be equal, and is used
by ==
.source§impl<'s> PartialEq<Int8Array> for Value
impl<'s> PartialEq<Int8Array> for Value
source§impl<'s> PartialEq<Integer> for Value
impl<'s> PartialEq<Integer> for Value
source§impl<'s> PartialEq<Name> for Value
impl<'s> PartialEq<Name> for Value
source§impl<'s> PartialEq<Number> for Value
impl<'s> PartialEq<Number> for Value
source§impl<'s> PartialEq<NumberObject> for Value
impl<'s> PartialEq<NumberObject> for Value
source§fn eq(&self, other: &NumberObject) -> bool
fn eq(&self, other: &NumberObject) -> bool
self
and other
values to be equal, and is used
by ==
.source§impl<'s> PartialEq<Object> for Value
impl<'s> PartialEq<Object> for Value
source§impl<'s> PartialEq<Primitive> for Value
impl<'s> PartialEq<Primitive> for Value
source§impl<'s> PartialEq<Promise> for Value
impl<'s> PartialEq<Promise> for Value
source§impl<'s> PartialEq<PromiseResolver> for Value
impl<'s> PartialEq<PromiseResolver> for Value
source§fn eq(&self, other: &PromiseResolver) -> bool
fn eq(&self, other: &PromiseResolver) -> bool
self
and other
values to be equal, and is used
by ==
.source§impl<'s> PartialEq<Proxy> for Value
impl<'s> PartialEq<Proxy> for Value
source§impl<'s> PartialEq<RegExp> for Value
impl<'s> PartialEq<RegExp> for Value
source§fn eq(&self, other: &SharedArrayBuffer) -> bool
fn eq(&self, other: &SharedArrayBuffer) -> bool
self
and other
values to be equal, and is used
by ==
.source§impl<'s> PartialEq<String> for Value
impl<'s> PartialEq<String> for Value
source§impl<'s> PartialEq<StringObject> for Value
impl<'s> PartialEq<StringObject> for Value
source§fn eq(&self, other: &StringObject) -> bool
fn eq(&self, other: &StringObject) -> bool
self
and other
values to be equal, and is used
by ==
.source§impl<'s> PartialEq<Symbol> for Value
impl<'s> PartialEq<Symbol> for Value
source§impl<'s> PartialEq<SymbolObject> for Value
impl<'s> PartialEq<SymbolObject> for Value
source§fn eq(&self, other: &SymbolObject) -> bool
fn eq(&self, other: &SymbolObject) -> bool
self
and other
values to be equal, and is used
by ==
.source§impl<'s> PartialEq<TypedArray> for Value
impl<'s> PartialEq<TypedArray> for Value
source§fn eq(&self, other: &TypedArray) -> bool
fn eq(&self, other: &TypedArray) -> bool
self
and other
values to be equal, and is used
by ==
.source§impl<'s> PartialEq<Uint16Array> for Value
impl<'s> PartialEq<Uint16Array> for Value
source§fn eq(&self, other: &Uint16Array) -> bool
fn eq(&self, other: &Uint16Array) -> bool
self
and other
values to be equal, and is used
by ==
.source§impl<'s> PartialEq<Uint32> for Value
impl<'s> PartialEq<Uint32> for Value
source§impl<'s> PartialEq<Uint32Array> for Value
impl<'s> PartialEq<Uint32Array> for Value
source§fn eq(&self, other: &Uint32Array) -> bool
fn eq(&self, other: &Uint32Array) -> bool
self
and other
values to be equal, and is used
by ==
.source§impl<'s> PartialEq<Uint8Array> for Value
impl<'s> PartialEq<Uint8Array> for Value
source§fn eq(&self, other: &Uint8Array) -> bool
fn eq(&self, other: &Uint8Array) -> bool
self
and other
values to be equal, and is used
by ==
.source§impl<'s> PartialEq<Uint8ClampedArray> for Value
impl<'s> PartialEq<Uint8ClampedArray> for Value
source§fn eq(&self, other: &Uint8ClampedArray) -> bool
fn eq(&self, other: &Uint8ClampedArray) -> bool
self
and other
values to be equal, and is used
by ==
.source§impl<'s> PartialEq<Value> for Array
impl<'s> PartialEq<Value> for Array
source§impl<'s> PartialEq<Value> for ArrayBuffer
impl<'s> PartialEq<Value> for ArrayBuffer
source§impl<'s> PartialEq<Value> for ArrayBufferView
impl<'s> PartialEq<Value> for ArrayBufferView
source§impl<'s> PartialEq<Value> for BigInt
impl<'s> PartialEq<Value> for BigInt
source§impl<'s> PartialEq<Value> for BigInt64Array
impl<'s> PartialEq<Value> for BigInt64Array
source§impl<'s> PartialEq<Value> for BigIntObject
impl<'s> PartialEq<Value> for BigIntObject
source§impl<'s> PartialEq<Value> for BigUint64Array
impl<'s> PartialEq<Value> for BigUint64Array
source§impl<'s> PartialEq<Value> for Boolean
impl<'s> PartialEq<Value> for Boolean
source§impl<'s> PartialEq<Value> for BooleanObject
impl<'s> PartialEq<Value> for BooleanObject
source§impl<'s> PartialEq<Value> for DataView
impl<'s> PartialEq<Value> for DataView
source§impl<'s> PartialEq<Value> for Date
impl<'s> PartialEq<Value> for Date
source§impl<'s> PartialEq<Value> for External
impl<'s> PartialEq<Value> for External
source§impl<'s> PartialEq<Value> for Float32Array
impl<'s> PartialEq<Value> for Float32Array
source§impl<'s> PartialEq<Value> for Float64Array
impl<'s> PartialEq<Value> for Float64Array
source§impl<'s> PartialEq<Value> for Function
impl<'s> PartialEq<Value> for Function
source§impl<'s> PartialEq<Value> for Int16Array
impl<'s> PartialEq<Value> for Int16Array
source§impl<'s> PartialEq<Value> for Int32
impl<'s> PartialEq<Value> for Int32
source§impl<'s> PartialEq<Value> for Int32Array
impl<'s> PartialEq<Value> for Int32Array
source§impl<'s> PartialEq<Value> for Int8Array
impl<'s> PartialEq<Value> for Int8Array
source§impl<'s> PartialEq<Value> for Integer
impl<'s> PartialEq<Value> for Integer
source§impl<'s> PartialEq<Value> for Map
impl<'s> PartialEq<Value> for Map
source§impl<'s> PartialEq<Value> for Name
impl<'s> PartialEq<Value> for Name
source§impl<'s> PartialEq<Value> for Number
impl<'s> PartialEq<Value> for Number
source§impl<'s> PartialEq<Value> for NumberObject
impl<'s> PartialEq<Value> for NumberObject
source§impl<'s> PartialEq<Value> for Object
impl<'s> PartialEq<Value> for Object
source§impl<'s> PartialEq<Value> for Primitive
impl<'s> PartialEq<Value> for Primitive
source§impl<'s> PartialEq<Value> for Promise
impl<'s> PartialEq<Value> for Promise
source§impl<'s> PartialEq<Value> for PromiseResolver
impl<'s> PartialEq<Value> for PromiseResolver
source§impl<'s> PartialEq<Value> for Proxy
impl<'s> PartialEq<Value> for Proxy
source§impl<'s> PartialEq<Value> for RegExp
impl<'s> PartialEq<Value> for RegExp
source§impl<'s> PartialEq<Value> for Set
impl<'s> PartialEq<Value> for Set
source§impl<'s> PartialEq<Value> for String
impl<'s> PartialEq<Value> for String
source§impl<'s> PartialEq<Value> for StringObject
impl<'s> PartialEq<Value> for StringObject
source§impl<'s> PartialEq<Value> for Symbol
impl<'s> PartialEq<Value> for Symbol
source§impl<'s> PartialEq<Value> for SymbolObject
impl<'s> PartialEq<Value> for SymbolObject
source§impl<'s> PartialEq<Value> for TypedArray
impl<'s> PartialEq<Value> for TypedArray
source§impl<'s> PartialEq<Value> for Uint16Array
impl<'s> PartialEq<Value> for Uint16Array
source§impl<'s> PartialEq<Value> for Uint32
impl<'s> PartialEq<Value> for Uint32
source§impl<'s> PartialEq<Value> for Uint32Array
impl<'s> PartialEq<Value> for Uint32Array
source§impl<'s> PartialEq<Value> for Uint8Array
impl<'s> PartialEq<Value> for Uint8Array
source§impl<'s> PartialEq<Value> for Uint8ClampedArray
impl<'s> PartialEq<Value> for Uint8ClampedArray
source§impl<'s> PartialEq<Value> for Value
impl<'s> PartialEq<Value> for Value
source§impl<'s> PartialEq<Value> for WasmMemoryObject
impl<'s> PartialEq<Value> for WasmMemoryObject
source§impl<'s> PartialEq<Value> for WasmModuleObject
impl<'s> PartialEq<Value> for WasmModuleObject
source§impl<'s> PartialEq<WasmMemoryObject> for Value
impl<'s> PartialEq<WasmMemoryObject> for Value
source§fn eq(&self, other: &WasmMemoryObject) -> bool
fn eq(&self, other: &WasmMemoryObject) -> bool
self
and other
values to be equal, and is used
by ==
.source§impl<'s> PartialEq<WasmModuleObject> for Value
impl<'s> PartialEq<WasmModuleObject> for Value
source§fn eq(&self, other: &WasmModuleObject) -> bool
fn eq(&self, other: &WasmModuleObject) -> bool
self
and other
values to be equal, and is used
by ==
.