Enum boa_engine::value::JsValue
source · pub enum JsValue {
Null,
Undefined,
Boolean(bool),
String(JsString),
Rational(f64),
Integer(i32),
BigInt(JsBigInt),
Object(JsObject),
Symbol(JsSymbol),
}
Expand description
A Javascript value
Variants§
Null
null
- A null value, for when a value doesn’t exist.
Undefined
undefined
- An undefined value, for when a field or index doesn’t exist.
Boolean(bool)
boolean
- A true
/ false
value, for if a certain criteria is met.
String(JsString)
String
- A UTF-16 string, such as "Hello, world"
.
Rational(f64)
Number
- A 64-bit floating point number, such as 3.1415
Integer(i32)
Number
- A 32-bit integer, such as 42
.
BigInt(JsBigInt)
BigInt
- holds any arbitrary large signed integer.
Object(JsObject)
Object
- An object, such as Math
, represented by a binary tree of string keys to Javascript values.
Symbol(JsSymbol)
Symbol
- A Symbol Primitive type.
Implementations§
source§impl JsValue
impl JsValue
sourcepub fn get_iterator(
&self,
context: &mut Context,
hint: Option<IteratorHint>,
method: Option<JsObject>
) -> JsResult<IteratorRecord>
pub fn get_iterator( &self, context: &mut Context, hint: Option<IteratorHint>, method: Option<JsObject> ) -> JsResult<IteratorRecord>
source§impl JsValue
impl JsValue
source§impl JsValue
impl JsValue
sourcepub fn from_json(json: &Value, context: &mut Context) -> JsResult<Self>
pub fn from_json(json: &Value, context: &mut Context) -> JsResult<Self>
Converts a serde_json::Value
to a JsValue
.
§Example
use boa_engine::{Context, JsValue};
let data = r#"
{
"name": "John Doe",
"age": 43,
"phones": [
"+44 1234567",
"+44 2345678"
]
}"#;
let json: serde_json::Value = serde_json::from_str(data).unwrap();
let mut context = Context::default();
let value = JsValue::from_json(&json, &mut context).unwrap();
sourcepub fn to_json(&self, context: &mut Context) -> JsResult<Value>
pub fn to_json(&self, context: &mut Context) -> JsResult<Value>
Converts the JsValue
to a serde_json::Value
.
§Example
use boa_engine::{Context, JsValue};
let data = r#"
{
"name": "John Doe",
"age": 43,
"phones": [
"+44 1234567",
"+44 2345678"
]
}"#;
let json: serde_json::Value = serde_json::from_str(data).unwrap();
let mut context = Context::default();
let value = JsValue::from_json(&json, &mut context).unwrap();
let back_to_json = value.to_json(&mut context).unwrap();
§Panics
Panics if the JsValue
is Undefined
.
source§impl JsValue
impl JsValue
sourcepub fn display_obj(&self, print_internals: bool) -> String
pub fn display_obj(&self, print_internals: bool) -> String
A helper function for specifically printing object values
source§impl JsValue
impl JsValue
sourcepub fn strict_equals(&self, other: &Self) -> bool
pub fn strict_equals(&self, other: &Self) -> bool
Strict equality comparison.
This method is executed when doing strict equality comparisons with the ===
operator.
For more information, check https://tc39.es/ecma262/#sec-strict-equality-comparison.
sourcepub fn equals(&self, other: &Self, context: &mut Context) -> JsResult<bool>
pub fn equals(&self, other: &Self, context: &mut Context) -> JsResult<bool>
Abstract equality comparison.
This method is executed when doing abstract equality comparisons with the ==
operator.
For more information, check https://tc39.es/ecma262/#sec-abstract-equality-comparison
sourcepub fn same_value(x: &Self, y: &Self) -> bool
pub fn same_value(x: &Self, y: &Self) -> bool
The internal comparison abstract operation SameValue(x, y), where x and y are ECMAScript language values, produces true or false.
More information:
sourcepub fn same_value_zero(x: &Self, y: &Self) -> bool
pub fn same_value_zero(x: &Self, y: &Self) -> bool
The internal comparison abstract operation SameValueZero(x, y)
,
where x
and y
are ECMAScript language values, produces true
or false
.
SameValueZero
differs from SameValue
only in its treatment of +0
and -0
.
More information:
source§impl JsValue
impl JsValue
sourcepub fn add(&self, other: &Self, context: &mut Context) -> JsResult<Self>
pub fn add(&self, other: &Self, context: &mut Context) -> JsResult<Self>
Perform the binary +
operator on the value and return the result.
sourcepub fn sub(&self, other: &Self, context: &mut Context) -> JsResult<Self>
pub fn sub(&self, other: &Self, context: &mut Context) -> JsResult<Self>
Perform the binary -
operator on the value and return the result.
sourcepub fn mul(&self, other: &Self, context: &mut Context) -> JsResult<Self>
pub fn mul(&self, other: &Self, context: &mut Context) -> JsResult<Self>
Perform the binary *
operator on the value and return the result.
sourcepub fn div(&self, other: &Self, context: &mut Context) -> JsResult<Self>
pub fn div(&self, other: &Self, context: &mut Context) -> JsResult<Self>
Perform the binary /
operator on the value and return the result.
sourcepub fn rem(&self, other: &Self, context: &mut Context) -> JsResult<Self>
pub fn rem(&self, other: &Self, context: &mut Context) -> JsResult<Self>
Perform the binary %
operator on the value and return the result.
sourcepub fn pow(&self, other: &Self, context: &mut Context) -> JsResult<Self>
pub fn pow(&self, other: &Self, context: &mut Context) -> JsResult<Self>
Perform the binary **
operator on the value and return the result.
sourcepub fn bitand(&self, other: &Self, context: &mut Context) -> JsResult<Self>
pub fn bitand(&self, other: &Self, context: &mut Context) -> JsResult<Self>
Perform the binary &
operator on the value and return the result.
sourcepub fn bitor(&self, other: &Self, context: &mut Context) -> JsResult<Self>
pub fn bitor(&self, other: &Self, context: &mut Context) -> JsResult<Self>
Perform the binary |
operator on the value and return the result.
sourcepub fn bitxor(&self, other: &Self, context: &mut Context) -> JsResult<Self>
pub fn bitxor(&self, other: &Self, context: &mut Context) -> JsResult<Self>
Perform the binary ^
operator on the value and return the result.
sourcepub fn shl(&self, other: &Self, context: &mut Context) -> JsResult<Self>
pub fn shl(&self, other: &Self, context: &mut Context) -> JsResult<Self>
Perform the binary <<
operator on the value and return the result.
sourcepub fn shr(&self, other: &Self, context: &mut Context) -> JsResult<Self>
pub fn shr(&self, other: &Self, context: &mut Context) -> JsResult<Self>
Perform the binary >>
operator on the value and return the result.
sourcepub fn ushr(&self, other: &Self, context: &mut Context) -> JsResult<Self>
pub fn ushr(&self, other: &Self, context: &mut Context) -> JsResult<Self>
Perform the binary >>>
operator on the value and return the result.
sourcepub fn abstract_relation(
&self,
other: &Self,
left_first: bool,
context: &mut Context
) -> JsResult<AbstractRelation>
pub fn abstract_relation( &self, other: &Self, left_first: bool, context: &mut Context ) -> JsResult<AbstractRelation>
Abstract relational comparison
The comparison x < y
, where x
and y
are values, produces true
, false
,
or undefined
(which indicates that at least one operand is NaN
).
In addition to x
and y
the algorithm takes a Boolean flag named LeftFirst
as a parameter.
The flag is used to control the order in which operations with potentially visible side-effects
are performed upon x
and y
. It is necessary because ECMAScript specifies left to right evaluation
of expressions. The default value of LeftFirst
is true
and indicates that the x
parameter
corresponds to an expression that occurs to the left of the y
parameter’s corresponding expression.
If LeftFirst
is false
, the reverse is the case and operations must be performed upon y
before x
.
More Information:
sourcepub fn lt(&self, other: &Self, context: &mut Context) -> JsResult<bool>
pub fn lt(&self, other: &Self, context: &mut Context) -> JsResult<bool>
The less than operator (<
) returns true
if the left operand is less than the right operand,
and false
otherwise.
More Information:
sourcepub fn le(&self, other: &Self, context: &mut Context) -> JsResult<bool>
pub fn le(&self, other: &Self, context: &mut Context) -> JsResult<bool>
The less than or equal operator (<=
) returns true
if the left operand is less than
or equal to the right operand, and false
otherwise.
More Information:
sourcepub fn gt(&self, other: &Self, context: &mut Context) -> JsResult<bool>
pub fn gt(&self, other: &Self, context: &mut Context) -> JsResult<bool>
The greater than operator (>
) returns true
if the left operand is greater than
the right operand, and false
otherwise.
More Information:
source§impl JsValue
impl JsValue
sourcepub const fn get_type(&self) -> Type
pub const fn get_type(&self) -> Type
Get the type of a value
This is the abstract operation Type(v), as described in https://tc39.es/ecma262/multipage/ecmascript-data-types-and-values.html#sec-ecmascript-language-types.
Check JsValue::type_of
if you need to call the typeof
operator.
source§impl JsValue
impl JsValue
sourcepub const fn positive_infinity() -> Self
pub const fn positive_infinity() -> Self
Creates a new number with Infinity
value.
sourcepub const fn negative_infinity() -> Self
pub const fn negative_infinity() -> Self
Creates a new number with -Infinity
value.
sourcepub const fn as_object(&self) -> Option<&JsObject>
pub const fn as_object(&self) -> Option<&JsObject>
Returns the object if the value is object, otherwise None
.
sourcepub fn is_callable(&self) -> bool
pub fn is_callable(&self) -> bool
It determines if the value is a callable function with a [[Call]]
internal method.
More information:
sourcepub fn as_callable(&self) -> Option<&JsObject>
pub fn as_callable(&self) -> Option<&JsObject>
Returns the callable value if the value is callable, otherwise None
.
sourcepub fn is_constructor(&self) -> bool
pub fn is_constructor(&self) -> bool
Returns true if the value is a constructor object.
sourcepub fn as_constructor(&self) -> Option<&JsObject>
pub fn as_constructor(&self) -> Option<&JsObject>
Returns the constructor if the value is a constructor, otherwise None
.
sourcepub fn is_promise(&self) -> bool
pub fn is_promise(&self) -> bool
Returns true if the value is a promise object.
sourcepub fn as_promise(&self) -> Option<&JsObject>
pub fn as_promise(&self) -> Option<&JsObject>
Returns the promise if the value is a promise, otherwise None
.
sourcepub fn as_symbol(&self) -> Option<JsSymbol>
pub fn as_symbol(&self) -> Option<JsSymbol>
Returns the symbol if the value is a symbol, otherwise None
.
sourcepub const fn is_undefined(&self) -> bool
pub const fn is_undefined(&self) -> bool
Returns true if the value is undefined.
sourcepub const fn is_null_or_undefined(&self) -> bool
pub const fn is_null_or_undefined(&self) -> bool
Returns true if the value is null or undefined.
sourcepub const fn is_double(&self) -> bool
pub const fn is_double(&self) -> bool
Returns true if the value is a 64-bit floating-point number.
sourcepub fn is_integer(&self) -> bool
pub fn is_integer(&self) -> bool
Returns true if the value is integer.
sourcepub fn as_number(&self) -> Option<f64>
pub fn as_number(&self) -> Option<f64>
Returns the number if the value is a number, otherwise None
.
sourcepub const fn as_string(&self) -> Option<&JsString>
pub const fn as_string(&self) -> Option<&JsString>
Returns the string if the value is a string, otherwise None
.
sourcepub const fn is_boolean(&self) -> bool
pub const fn is_boolean(&self) -> bool
Returns true if the value is a boolean.
sourcepub const fn as_boolean(&self) -> Option<bool>
pub const fn as_boolean(&self) -> Option<bool>
Returns the boolean if the value is a boolean, otherwise None
.
sourcepub const fn as_bigint(&self) -> Option<&JsBigInt>
pub const fn as_bigint(&self) -> Option<&JsBigInt>
Returns an optional reference to a BigInt
if the value is a BigInt
primitive.
sourcepub fn to_boolean(&self) -> bool
pub fn to_boolean(&self) -> bool
sourcepub fn to_primitive(
&self,
context: &mut Context,
preferred_type: PreferredType
) -> JsResult<Self>
pub fn to_primitive( &self, context: &mut Context, preferred_type: PreferredType ) -> JsResult<Self>
The abstract operation ToPrimitive
takes an input argument and an optional argument
PreferredType
.
sourcepub const fn display(&self) -> ValueDisplay<'_>
pub const fn display(&self) -> ValueDisplay<'_>
Returns an object that implements Display
.
By default the internals are not shown, but they can be toggled
with ValueDisplay::internals
method.
§Examples
use boa_engine::JsValue;
let value = JsValue::new(3);
println!("{}", value.display());
sourcepub fn to_string(&self, context: &mut Context) -> JsResult<JsString>
pub fn to_string(&self, context: &mut Context) -> JsResult<JsString>
Converts the value to a string.
This function is equivalent to String(value)
in JavaScript.
sourcepub fn to_object(&self, context: &mut Context) -> JsResult<JsObject>
pub fn to_object(&self, context: &mut Context) -> JsResult<JsObject>
Converts the value to an Object.
This function is equivalent to Object(value)
in JavaScript.
sourcepub fn to_property_key(&self, context: &mut Context) -> JsResult<PropertyKey>
pub fn to_property_key(&self, context: &mut Context) -> JsResult<PropertyKey>
Converts the value to a PropertyKey
, that can be used as a key for properties.
sourcepub fn to_numeric(&self, context: &mut Context) -> JsResult<Numeric>
pub fn to_numeric(&self, context: &mut Context) -> JsResult<Numeric>
It returns value converted to a numeric value of type Number
or BigInt
.
sourcepub fn to_u32(&self, context: &mut Context) -> JsResult<u32>
pub fn to_u32(&self, context: &mut Context) -> JsResult<u32>
Converts a value to an integral 32 bit unsigned integer.
This function is equivalent to value | 0
in JavaScript
sourcepub fn to_i32(&self, context: &mut Context) -> JsResult<i32>
pub fn to_i32(&self, context: &mut Context) -> JsResult<i32>
Converts a value to an integral 32 bit signed integer.
sourcepub fn to_uint8_clamp(&self, context: &mut Context) -> JsResult<u8>
pub fn to_uint8_clamp(&self, context: &mut Context) -> JsResult<u8>
sourcepub fn to_big_int64(&self, context: &mut Context) -> JsResult<i64>
pub fn to_big_int64(&self, context: &mut Context) -> JsResult<i64>
sourcepub fn to_big_uint64(&self, context: &mut Context) -> JsResult<u64>
pub fn to_big_uint64(&self, context: &mut Context) -> JsResult<u64>
sourcepub fn to_index(&self, context: &mut Context) -> JsResult<u64>
pub fn to_index(&self, context: &mut Context) -> JsResult<u64>
Converts a value to a non-negative integer if it is a valid integer index value.
sourcepub fn to_length(&self, context: &mut Context) -> JsResult<u64>
pub fn to_length(&self, context: &mut Context) -> JsResult<u64>
Converts argument to an integer suitable for use as the length of an array-like object.
sourcepub fn to_integer_or_infinity(
&self,
context: &mut Context
) -> JsResult<IntegerOrInfinity>
pub fn to_integer_or_infinity( &self, context: &mut Context ) -> JsResult<IntegerOrInfinity>
Abstract operation ToIntegerOrInfinity ( argument )
This method converts a Value
to an integer representing its Number
value with
fractional part truncated, or to +∞ or -∞ when that Number
value is infinite.
More information:
sourcepub fn to_number(&self, context: &mut Context) -> JsResult<f64>
pub fn to_number(&self, context: &mut Context) -> JsResult<f64>
Converts a value to a double precision floating point.
This function is equivalent to the unary +
operator (+value
) in JavaScript
sourcepub fn to_numeric_number(&self, context: &mut Context) -> JsResult<f64>
pub fn to_numeric_number(&self, context: &mut Context) -> JsResult<f64>
This is a more specialized version of to_numeric
, including BigInt
.
This function is equivalent to Number(value)
in JavaScript
sourcepub fn require_object_coercible(&self) -> JsResult<&Self>
pub fn require_object_coercible(&self) -> JsResult<&Self>
Check if the Value
can be converted to an Object
The abstract operation RequireObjectCoercible
takes argument argument.
It throws an error if argument is a value that cannot be converted to an Object using ToObject
.
It is defined by Table 15
More information:
sourcepub fn to_property_descriptor(
&self,
context: &mut Context
) -> JsResult<PropertyDescriptor>
pub fn to_property_descriptor( &self, context: &mut Context ) -> JsResult<PropertyDescriptor>
sourcepub fn type_of(&self) -> &'static str
pub fn type_of(&self) -> &'static str
typeof
operator. Returns a string representing the type of the
given ECMA Value.
More information:
sourcepub fn js_type_of(&self) -> JsString
pub fn js_type_of(&self) -> JsString
Same as JsValue::type_of
, but returning a JsString
instead.
Trait Implementations§
source§impl From<&PropertyKey> for JsValue
impl From<&PropertyKey> for JsValue
source§fn from(property_key: &PropertyKey) -> Self
fn from(property_key: &PropertyKey) -> Self
source§impl From<GeneratorResumeKind> for JsValue
impl From<GeneratorResumeKind> for JsValue
source§fn from(value: GeneratorResumeKind) -> Self
fn from(value: GeneratorResumeKind) -> Self
source§impl From<JsArrayBuffer> for JsValue
impl From<JsArrayBuffer> for JsValue
source§fn from(o: JsArrayBuffer) -> Self
fn from(o: JsArrayBuffer) -> Self
source§impl From<JsDataView> for JsValue
impl From<JsDataView> for JsValue
source§fn from(o: JsDataView) -> Self
fn from(o: JsDataView) -> Self
source§impl From<JsFloat32Array> for JsValue
impl From<JsFloat32Array> for JsValue
source§fn from(o: JsFloat32Array) -> Self
fn from(o: JsFloat32Array) -> Self
source§impl From<JsFloat64Array> for JsValue
impl From<JsFloat64Array> for JsValue
source§fn from(o: JsFloat64Array) -> Self
fn from(o: JsFloat64Array) -> Self
source§impl From<JsFunction> for JsValue
impl From<JsFunction> for JsValue
source§fn from(o: JsFunction) -> Self
fn from(o: JsFunction) -> Self
source§impl From<JsGenerator> for JsValue
impl From<JsGenerator> for JsValue
source§fn from(o: JsGenerator) -> Self
fn from(o: JsGenerator) -> Self
source§impl From<JsInt16Array> for JsValue
impl From<JsInt16Array> for JsValue
source§fn from(o: JsInt16Array) -> Self
fn from(o: JsInt16Array) -> Self
source§impl From<JsInt32Array> for JsValue
impl From<JsInt32Array> for JsValue
source§fn from(o: JsInt32Array) -> Self
fn from(o: JsInt32Array) -> Self
source§impl From<JsInt8Array> for JsValue
impl From<JsInt8Array> for JsValue
source§fn from(o: JsInt8Array) -> Self
fn from(o: JsInt8Array) -> Self
source§impl From<JsMapIterator> for JsValue
impl From<JsMapIterator> for JsValue
source§fn from(o: JsMapIterator) -> Self
fn from(o: JsMapIterator) -> Self
source§impl From<JsSetIterator> for JsValue
impl From<JsSetIterator> for JsValue
source§fn from(o: JsSetIterator) -> Self
fn from(o: JsSetIterator) -> Self
source§fn from(o: JsSharedArrayBuffer) -> Self
fn from(o: JsSharedArrayBuffer) -> Self
source§impl From<JsTypedArray> for JsValue
impl From<JsTypedArray> for JsValue
source§fn from(o: JsTypedArray) -> Self
fn from(o: JsTypedArray) -> Self
source§impl From<JsUint16Array> for JsValue
impl From<JsUint16Array> for JsValue
source§fn from(o: JsUint16Array) -> Self
fn from(o: JsUint16Array) -> Self
source§impl From<JsUint32Array> for JsValue
impl From<JsUint32Array> for JsValue
source§fn from(o: JsUint32Array) -> Self
fn from(o: JsUint32Array) -> Self
source§impl From<JsUint8Array> for JsValue
impl From<JsUint8Array> for JsValue
source§fn from(o: JsUint8Array) -> Self
fn from(o: JsUint8Array) -> Self
source§impl From<PropertyKey> for JsValue
impl From<PropertyKey> for JsValue
source§fn from(property_key: PropertyKey) -> Self
fn from(property_key: PropertyKey) -> Self
source§impl PartialEq for JsValue
impl PartialEq for JsValue
source§impl Trace for JsValue
impl Trace for JsValue
source§unsafe fn trace_non_roots(&self)
unsafe fn trace_non_roots(&self)
source§fn run_finalizer(&self)
fn run_finalizer(&self)
Finalize::finalize
on this object and all
contained subobjects.impl Eq for JsValue
Auto Trait Implementations§
impl !RefUnwindSafe for JsValue
impl !Send for JsValue
impl !Sync for JsValue
impl Unpin for JsValue
impl !UnwindSafe for JsValue
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.source§impl<T> Pipe for Twhere
T: ?Sized,
impl<T> Pipe for Twhere
T: ?Sized,
source§fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
source§fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
self
and passes that borrow into the pipe function. Read moresource§fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
self
and passes that borrow into the pipe function. Read moresource§fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
source§fn pipe_borrow_mut<'a, B, R>(
&'a mut self,
func: impl FnOnce(&'a mut B) -> R
) -> R
fn pipe_borrow_mut<'a, B, R>( &'a mut self, func: impl FnOnce(&'a mut B) -> R ) -> R
source§fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
self
, then passes self.as_ref()
into the pipe function.source§fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
self
, then passes self.as_mut()
into the pipe
function.source§fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
self
, then passes self.deref()
into the pipe function.source§impl<T> Tap for T
impl<T> Tap for T
source§fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
Borrow<B>
of a value. Read moresource§fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
BorrowMut<B>
of a value. Read moresource§fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
AsRef<R>
view of a value. Read moresource§fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
AsMut<R>
view of a value. Read moresource§fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
Deref::Target
of a value. Read moresource§fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
Deref::Target
of a value. Read moresource§fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
.tap()
only in debug builds, and is erased in release builds.source§fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
.tap_mut()
only in debug builds, and is erased in release
builds.source§fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
.tap_borrow()
only in debug builds, and is erased in release
builds.source§fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
.tap_borrow_mut()
only in debug builds, and is erased in release
builds.source§fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
.tap_ref()
only in debug builds, and is erased in release
builds.source§fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
.tap_ref_mut()
only in debug builds, and is erased in release
builds.source§fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
.tap_deref()
only in debug builds, and is erased in release
builds.