pub struct JsValue(/* private fields */);Expand description
A generic JavaScript value. This can be any ECMAScript language valid value.
This is a wrapper around the actual value, which is stored in an opaque type.This allows for internal changes to the value without affecting the public API.
letmutcontext = Context::default();letvalue = JsValue::new(3);assert_eq!(value.to_string(&mutcontext),Ok(js_string!("3")));Implementations§
Source§implJsValue
implJsValue
Sourcepub fnget_iterator_from_method( &self, method: &JsObject, context: &mutContext,) ->JsResult<IteratorRecord>
pub fnget_iterator_from_method( &self, method: &JsObject, context: &mutContext,) ->JsResult<IteratorRecord>
Sourcepub fnget_iterator( &self, hint:IteratorHint, context: &mutContext,) ->JsResult<IteratorRecord>
pub fnget_iterator( &self, hint:IteratorHint, context: &mutContext,) ->JsResult<IteratorRecord>
Source§implJsValue
implJsValue
Sourcepub fnordinary_has_instance( function: &Self, object: &Self, context: &mutContext,) ->JsResult<bool>
pub fnordinary_has_instance( function: &Self, object: &Self, context: &mutContext,) ->JsResult<bool>
Source§implJsValue
implJsValue
Sourcepub fnfrom_json(json: &Value, context: &mutContext) ->JsResult<Self>
pub fnfrom_json(json: &Value, context: &mutContext) ->JsResult<Self>
Converts aserde_json::Value to aJsValue.
§Example
useboa_engine::{Context, JsValue};letdata =r#" { "name": "John Doe", "age": 43, "phones": [ "+44 1234567", "+44 2345678" ] }"#;letjson: serde_json::Value = serde_json::from_str(data).unwrap();letmutcontext = Context::default();letvalue = JsValue::from_json(&json,&mutcontext).unwrap();Sourcepub fnto_json(&self, context: &mutContext) ->JsResult<Option<Value>>
pub fnto_json(&self, context: &mutContext) ->JsResult<Option<Value>>
Converts theJsValue to aserde_json::Value.
If theJsValue isUndefined, this method will returnNone.Otherwise it will return the correspondingserde_json::Value.
§Example
useboa_engine::{Context, JsValue};letdata =r#" { "name": "John Doe", "age": 43, "phones": [ "+44 1234567", "+44 2345678" ] }"#;letjson: serde_json::Value = serde_json::from_str(data).unwrap();letmutcontext = Context::default();letvalue = JsValue::from_json(&json,&mutcontext).unwrap();letback_to_json = value.to_json(&mutcontext).unwrap();Source§implJsValue
implJsValue
Sourcepub fndisplay_obj(&self, print_internals:bool) ->String
pub fndisplay_obj(&self, print_internals:bool) ->String
A helper function for specifically printing object values
Source§implJsValue
implJsValue
Sourcepub fndeep_strict_equals( &self, other: &Self, context: &mutContext,) ->JsResult<bool>
pub fndeep_strict_equals( &self, other: &Self, context: &mutContext,) ->JsResult<bool>
Deep strict equality.
If the value is an object/array, also compare the key-values.It usesstrict_equals() for non-object values.
Sourcepub fnstrict_equals(&self, other: &Self) ->bool
pub fnstrict_equals(&self, other: &Self) ->bool
Strict equality comparison.
This method is executed when doing strict equality comparisons with the=== operator.For more information, checkhttps://tc39.es/ecma262/#sec-strict-equality-comparison.
Sourcepub fnequals(&self, other: &Self, context: &mutContext) ->JsResult<bool>
pub fnequals(&self, other: &Self, context: &mutContext) ->JsResult<bool>
Abstract equality comparison.
This method is executed when doing abstract equality comparisons with the== operator.For more information, checkhttps://tc39.es/ecma262/#sec-abstract-equality-comparison
Sourcepub fnsame_value(x: &Self, y: &Self) ->bool
pub fnsame_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 fnsame_value_zero(x: &Self, y: &Self) ->bool
pub fnsame_value_zero(x: &Self, y: &Self) ->bool
The internal comparison abstract operationSameValueZero(x, y),wherex andy are ECMAScript language values, producestrue orfalse.
SameValueZero differs fromSameValue only in its treatment of+0 and-0.
More information:
Source§implJsValue
implJsValue
Sourcepub fnadd(&self, other: &Self, context: &mutContext) ->JsResult<Self>
pub fnadd(&self, other: &Self, context: &mutContext) ->JsResult<Self>
Perform the binary+ operator on the value and return the result.
Sourcepub fnsub(&self, other: &Self, context: &mutContext) ->JsResult<Self>
pub fnsub(&self, other: &Self, context: &mutContext) ->JsResult<Self>
Perform the binary- operator on the value and return the result.
Sourcepub fnmul(&self, other: &Self, context: &mutContext) ->JsResult<Self>
pub fnmul(&self, other: &Self, context: &mutContext) ->JsResult<Self>
Perform the binary* operator on the value and return the result.
Sourcepub fndiv(&self, other: &Self, context: &mutContext) ->JsResult<Self>
pub fndiv(&self, other: &Self, context: &mutContext) ->JsResult<Self>
Perform the binary/ operator on the value and return the result.
Sourcepub fnrem(&self, other: &Self, context: &mutContext) ->JsResult<Self>
pub fnrem(&self, other: &Self, context: &mutContext) ->JsResult<Self>
Perform the binary% operator on the value and return the result.
Sourcepub fnpow(&self, other: &Self, context: &mutContext) ->JsResult<Self>
pub fnpow(&self, other: &Self, context: &mutContext) ->JsResult<Self>
Perform the binary** operator on the value and return the result.
Sourcepub fnbitand(&self, other: &Self, context: &mutContext) ->JsResult<Self>
pub fnbitand(&self, other: &Self, context: &mutContext) ->JsResult<Self>
Perform the binary& operator on the value and return the result.
Sourcepub fnbitor(&self, other: &Self, context: &mutContext) ->JsResult<Self>
pub fnbitor(&self, other: &Self, context: &mutContext) ->JsResult<Self>
Perform the binary| operator on the value and return the result.
Sourcepub fnbitxor(&self, other: &Self, context: &mutContext) ->JsResult<Self>
pub fnbitxor(&self, other: &Self, context: &mutContext) ->JsResult<Self>
Perform the binary^ operator on the value and return the result.
Sourcepub fnshl(&self, other: &Self, context: &mutContext) ->JsResult<Self>
pub fnshl(&self, other: &Self, context: &mutContext) ->JsResult<Self>
Perform the binary<< operator on the value and return the result.
Sourcepub fnshr(&self, other: &Self, context: &mutContext) ->JsResult<Self>
pub fnshr(&self, other: &Self, context: &mutContext) ->JsResult<Self>
Perform the binary>> operator on the value and return the result.
Sourcepub fnushr(&self, other: &Self, context: &mutContext) ->JsResult<Self>
pub fnushr(&self, other: &Self, context: &mutContext) ->JsResult<Self>
Perform the binary>>> operator on the value and return the result.
Sourcepub fninstance_of( &self, target: &Self, context: &mutContext,) ->JsResult<bool>
pub fninstance_of( &self, target: &Self, context: &mutContext,) ->JsResult<bool>
Sourcepub fnabstract_relation( &self, other: &Self, left_first:bool, context: &mutContext,) ->JsResult<AbstractRelation>
pub fnabstract_relation( &self, other: &Self, left_first:bool, context: &mutContext,) ->JsResult<AbstractRelation>
Abstract relational comparison
The comparisonx < y, wherex andy are values, producestrue,false,orundefined (which indicates that at least one operand isNaN).
In addition tox andy the algorithm takes a Boolean flag namedLeftFirst as a parameter.The flag is used to control the order in which operations with potentially visible side-effectsare performed uponx andy. It is necessary because ECMAScript specifies left to right evaluationof expressions. The default value ofLeftFirst istrue and indicates that thex parametercorresponds to an expression that occurs to the left of they parameter’s corresponding expression.
IfLeftFirst isfalse, the reverse is the case and operations must be performed upony beforex.
More Information:
Sourcepub fnlt(&self, other: &Self, context: &mutContext) ->JsResult<bool>
pub fnlt(&self, other: &Self, context: &mutContext) ->JsResult<bool>
The less than operator (<) returnstrue if the left operand is less than the right operand,andfalse otherwise.
More Information:
Sourcepub fnle(&self, other: &Self, context: &mutContext) ->JsResult<bool>
pub fnle(&self, other: &Self, context: &mutContext) ->JsResult<bool>
The less than or equal operator (<=) returnstrue if the left operand is less thanor equal to the right operand, andfalse otherwise.
More Information:
Sourcepub fngt(&self, other: &Self, context: &mutContext) ->JsResult<bool>
pub fngt(&self, other: &Self, context: &mutContext) ->JsResult<bool>
The greater than operator (>) returnstrue if the left operand is greater thanthe right operand, andfalse otherwise.
More Information:
Source§implJsValue
implJsValue
Sourcepub fnget_type(&self) ->Type
pub fnget_type(&self) ->Type
Get the type of a value
This is the abstract operation Type(v), as described inhttps://tc39.es/ecma262/multipage/ecmascript-data-types-and-values.html#sec-ecmascript-language-types.
CheckJsValue::type_of if you need to call thetypeof operator.
Source§implJsValue
implJsValue
Sourcepub const fnpositive_infinity() -> Self
pub const fnpositive_infinity() -> Self
Creates a new number withInfinity value.
Sourcepub const fnnegative_infinity() -> Self
pub const fnnegative_infinity() -> Self
Creates a new number with-Infinity value.
Sourcepub fnas_object(&self) ->Option<JsObject>
pub fnas_object(&self) ->Option<JsObject>
Returns the object if the value is object, otherwiseNone.
Sourcepub fninto_object(self) ->Option<JsObject>
pub fninto_object(self) ->Option<JsObject>
Consumes the value and return the inner object if it was an object.
Sourcepub fnis_callable(&self) ->bool
pub fnis_callable(&self) ->bool
It determines if the value is a callable function with a[[Call]] internal method.
More information:
Sourcepub fnas_callable(&self) ->Option<JsObject>
pub fnas_callable(&self) ->Option<JsObject>
Returns the callable value if the value is callable, otherwiseNone.
Sourcepub fnas_function(&self) ->Option<JsFunction>
pub fnas_function(&self) ->Option<JsFunction>
Returns aJsFunction if the value is callable, otherwiseNone.This is equivalent toJsFunction::from_object(value.as_callable()?).
Sourcepub fnis_constructor(&self) ->bool
pub fnis_constructor(&self) ->bool
Returns true if the value is a constructor object.
Sourcepub fnas_constructor(&self) ->Option<JsObject>
pub fnas_constructor(&self) ->Option<JsObject>
Returns the constructor if the value is a constructor, otherwiseNone.
Sourcepub fnis_promise(&self) ->bool
pub fnis_promise(&self) ->bool
Returns true if the value is a promise object.
Sourcepub fnas_promise(&self) ->Option<JsPromise>
pub fnas_promise(&self) ->Option<JsPromise>
Returns the value as a promise if the value is a promise, otherwiseNone.
Sourcepub fnas_regexp(&self) ->Option<JsRegExp>
pub fnas_regexp(&self) ->Option<JsRegExp>
Returns the value as a regular expression if the value is a regexp, otherwiseNone.
Sourcepub fnas_symbol(&self) ->Option<JsSymbol>
pub fnas_symbol(&self) ->Option<JsSymbol>
Returns the symbol if the value is a symbol, otherwiseNone.
Sourcepub fnis_undefined(&self) ->bool
pub fnis_undefined(&self) ->bool
Returns true if the value is undefined.
Sourcepub fnis_null_or_undefined(&self) ->bool
pub fnis_null_or_undefined(&self) ->bool
Returns true if the value is null or undefined.
Sourcepub fnas_i32(&self) ->Option<i32>
pub fnas_i32(&self) ->Option<i32>
Returns the number if the value is a finite integral Number value, otherwiseNone.
More information:
Sourcepub fnas_number(&self) ->Option<f64>
pub fnas_number(&self) ->Option<f64>
Returns the number if the value is a number, otherwiseNone.
Sourcepub fnas_string(&self) ->Option<JsString>
pub fnas_string(&self) ->Option<JsString>
Returns the string if the value is a string, otherwiseNone.
Sourcepub fnis_boolean(&self) ->bool
pub fnis_boolean(&self) ->bool
Returns true if the value is a boolean.
Sourcepub fnas_boolean(&self) ->Option<bool>
pub fnas_boolean(&self) ->Option<bool>
Returns the boolean if the value is a boolean, otherwiseNone.
Sourcepub fnto_boolean(&self) ->bool
pub fnto_boolean(&self) ->bool
Sourcepub fnto_primitive( &self, context: &mutContext, preferred_type:PreferredType,) ->JsResult<Self>
pub fnto_primitive( &self, context: &mutContext, preferred_type:PreferredType,) ->JsResult<Self>
The abstract operationToPrimitive takes an input argument and an optional argumentPreferredType.
Sourcepub const fndisplay(&self) ->ValueDisplay<'_>
pub const fndisplay(&self) ->ValueDisplay<'_>
Returns an object that implementsDisplay.
By default, the internals are not shown, but they can be toggledwithValueDisplay::internals method.
§Examples
useboa_engine::JsValue;letvalue = JsValue::new(3);println!("{}", value.display());Sourcepub fnto_string(&self, context: &mutContext) ->JsResult<JsString>
pub fnto_string(&self, context: &mutContext) ->JsResult<JsString>
Converts the value to a string.
This function is equivalent toString(value) in JavaScript.
Sourcepub fnto_object(&self, context: &mutContext) ->JsResult<JsObject>
pub fnto_object(&self, context: &mutContext) ->JsResult<JsObject>
Converts the value to an Object.
This function is equivalent toObject(value) in JavaScript.
Sourcepub fnto_property_key(&self, context: &mutContext) ->JsResult<PropertyKey>
pub fnto_property_key(&self, context: &mutContext) ->JsResult<PropertyKey>
Converts the value to aPropertyKey, that can be used as a key for properties.
Sourcepub fnto_numeric(&self, context: &mutContext) ->JsResult<Numeric>
pub fnto_numeric(&self, context: &mutContext) ->JsResult<Numeric>
It returns value converted to a numeric value of typeNumber orBigInt.
Sourcepub fnto_u32(&self, context: &mutContext) ->JsResult<u32>
pub fnto_u32(&self, context: &mutContext) ->JsResult<u32>
Converts a value to an integral 32-bit unsigned integer.
This function is equivalent tovalue | 0 in JavaScript
Sourcepub fnto_i32(&self, context: &mutContext) ->JsResult<i32>
pub fnto_i32(&self, context: &mutContext) ->JsResult<i32>
Converts a value to an integral 32-bit signed integer.
Sourcepub fnto_uint8_clamp(&self, context: &mutContext) ->JsResult<u8>
pub fnto_uint8_clamp(&self, context: &mutContext) ->JsResult<u8>
Sourcepub fnto_big_int64(&self, context: &mutContext) ->JsResult<i64>
pub fnto_big_int64(&self, context: &mutContext) ->JsResult<i64>
Sourcepub fnto_big_uint64(&self, context: &mutContext) ->JsResult<u64>
pub fnto_big_uint64(&self, context: &mutContext) ->JsResult<u64>
Sourcepub fnto_index(&self, context: &mutContext) ->JsResult<u64>
pub fnto_index(&self, context: &mutContext) ->JsResult<u64>
Converts a value to a non-negative integer if it is a valid integer index value.
Sourcepub fnto_length(&self, context: &mutContext) ->JsResult<u64>
pub fnto_length(&self, context: &mutContext) ->JsResult<u64>
Converts argument to an integer suitable for use as the length of an array-like object.
Sourcepub fnto_integer_or_infinity( &self, context: &mutContext,) ->JsResult<IntegerOrInfinity>
pub fnto_integer_or_infinity( &self, context: &mutContext,) ->JsResult<IntegerOrInfinity>
Abstract operationToIntegerOrInfinity ( argument )
This method converts aValue to an integer representing itsNumber value withfractional part truncated, or to +∞ or -∞ when thatNumber value is infinite.
More information:
Sourcepub fnto_number(&self, context: &mutContext) ->JsResult<f64>
pub fnto_number(&self, context: &mutContext) ->JsResult<f64>
Converts a value to a double precision floating point.
This function is equivalent to the unary+ operator (+value) in JavaScript
Sourcepub fnto_f16(&self, context: &mutContext) ->JsResult<f16>
pub fnto_f16(&self, context: &mutContext) ->JsResult<f16>
Converts a value to a 16-bit floating point.
Sourcepub fnto_f32(&self, context: &mutContext) ->JsResult<f32>
pub fnto_f32(&self, context: &mutContext) ->JsResult<f32>
Converts a value to a 32 bit floating point.
Sourcepub fnto_numeric_number(&self, context: &mutContext) ->JsResult<f64>
pub fnto_numeric_number(&self, context: &mutContext) ->JsResult<f64>
This is a more specialized version ofto_numeric, includingBigInt.
This function is equivalent toNumber(value) in JavaScript
Sourcepub fnrequire_object_coercible(&self) ->JsResult<&Self>
pub fnrequire_object_coercible(&self) ->JsResult<&Self>
Check if theValue can be converted to anObject
The abstract operationRequireObjectCoercible takes argument argument.It throws an error if argument is a value that cannot be converted to an Object usingToObject.It is defined byTable 15
More information:
Sourcepub fnto_property_descriptor( &self, context: &mutContext,) ->JsResult<PropertyDescriptor>
pub fnto_property_descriptor( &self, context: &mutContext,) ->JsResult<PropertyDescriptor>
Sourcepub fntype_of(&self) -> &'staticstr
pub fntype_of(&self) -> &'staticstr
typeof operator. Returns a string representing the type of thegiven ECMA Value.
More information:
Sourcepub fnjs_type_of(&self) ->JsString
pub fnjs_type_of(&self) ->JsString
Same asJsValue::type_of, but returning aJsString instead.
Sourcepub fnmap<T, F>(&self, f: F) ->Option<T>
pub fnmap<T, F>(&self, f: F) ->Option<T>
Maps aJsValue intoOption<T> where T is the result of anoperation on a defined value. If the value isJsValue::undefined,thenJsValue::map will return None.
§Example
useboa_engine::{Context, JsValue};letmutcontext = Context::default();letdefined_value = JsValue::from(5);letundefined = JsValue::undefined();letdefined_result = defined_value .map(|v| v.add(&JsValue::from(5),&mutcontext)) .transpose() .unwrap();letundefined_result = undefined .map(|v| v.add(&JsValue::from(5),&mutcontext)) .transpose() .unwrap();assert_eq!(defined_result,Some(JsValue::from(10u8)));assert_eq!(undefined_result,None);Sourcepub fnmap_or<T, F>(&self, default: T, f: F) -> T
pub fnmap_or<T, F>(&self, default: T, f: F) -> T
Maps aJsValue intoT where T is the result of anoperation on a defined value. If the value isJsValue::undefined,thenJsValue::map will return the provided default value.
§Example
useboa_engine::{Context, JsValue};letmutcontext = Context::default();letdefined_value = JsValue::from(5);letundefined = JsValue::undefined();letdefined_result = defined_value .map_or(Ok(JsValue::new(true)), |v| { v.add(&JsValue::from(5),&mutcontext) }) .unwrap();letundefined_result = undefined .map_or(Ok(JsValue::new(true)), |v| { v.add(&JsValue::from(5),&mutcontext) }) .unwrap();assert_eq!(defined_result, JsValue::new(10));assert_eq!(undefined_result, JsValue::new(true));Trait Implementations§
Source§implFrom<&PropertyKey> forJsValue
implFrom<&PropertyKey> forJsValue
Source§fnfrom(property_key: &PropertyKey) -> Self
fnfrom(property_key: &PropertyKey) -> Self
Source§implFrom<GeneratorResumeKind> forJsValue
implFrom<GeneratorResumeKind> forJsValue
Source§fnfrom(value:GeneratorResumeKind) -> Self
fnfrom(value:GeneratorResumeKind) -> Self
Source§implFrom<JsArrayBuffer> forJsValue
implFrom<JsArrayBuffer> forJsValue
Source§fnfrom(o:JsArrayBuffer) -> Self
fnfrom(o:JsArrayBuffer) -> Self
Source§implFrom<JsBigInt64Array> forJsValue
implFrom<JsBigInt64Array> forJsValue
Source§fnfrom(o:JsBigInt64Array) -> Self
fnfrom(o:JsBigInt64Array) -> Self
Source§implFrom<JsBigUint64Array> forJsValue
implFrom<JsBigUint64Array> forJsValue
Source§fnfrom(o:JsBigUint64Array) -> Self
fnfrom(o:JsBigUint64Array) -> Self
Source§implFrom<JsDataView> forJsValue
implFrom<JsDataView> forJsValue
Source§fnfrom(o:JsDataView) -> Self
fnfrom(o:JsDataView) -> Self
Source§implFrom<JsFloat16Array> forJsValue
implFrom<JsFloat16Array> forJsValue
Source§fnfrom(o:JsFloat16Array) -> Self
fnfrom(o:JsFloat16Array) -> Self
Source§implFrom<JsFloat32Array> forJsValue
implFrom<JsFloat32Array> forJsValue
Source§fnfrom(o:JsFloat32Array) -> Self
fnfrom(o:JsFloat32Array) -> Self
Source§implFrom<JsFloat64Array> forJsValue
implFrom<JsFloat64Array> forJsValue
Source§fnfrom(o:JsFloat64Array) -> Self
fnfrom(o:JsFloat64Array) -> Self
Source§implFrom<JsFunction> forJsValue
implFrom<JsFunction> forJsValue
Source§fnfrom(o:JsFunction) -> Self
fnfrom(o:JsFunction) -> Self
Source§implFrom<JsGenerator> forJsValue
implFrom<JsGenerator> forJsValue
Source§fnfrom(o:JsGenerator) -> Self
fnfrom(o:JsGenerator) -> Self
Source§implFrom<JsInt16Array> forJsValue
implFrom<JsInt16Array> forJsValue
Source§fnfrom(o:JsInt16Array) -> Self
fnfrom(o:JsInt16Array) -> Self
Source§implFrom<JsInt32Array> forJsValue
implFrom<JsInt32Array> forJsValue
Source§fnfrom(o:JsInt32Array) -> Self
fnfrom(o:JsInt32Array) -> Self
Source§implFrom<JsInt8Array> forJsValue
implFrom<JsInt8Array> forJsValue
Source§fnfrom(o:JsInt8Array) -> Self
fnfrom(o:JsInt8Array) -> Self
Source§implFrom<JsMapIterator> forJsValue
implFrom<JsMapIterator> forJsValue
Source§fnfrom(o:JsMapIterator) -> Self
fnfrom(o:JsMapIterator) -> Self
Source§implFrom<JsSetIterator> forJsValue
implFrom<JsSetIterator> forJsValue
Source§fnfrom(o:JsSetIterator) -> Self
fnfrom(o:JsSetIterator) -> Self
Source§implFrom<JsSharedArrayBuffer> forJsValue
implFrom<JsSharedArrayBuffer> forJsValue
Source§fnfrom(o:JsSharedArrayBuffer) -> Self
fnfrom(o:JsSharedArrayBuffer) -> Self
Source§implFrom<JsTypedArray> forJsValue
implFrom<JsTypedArray> forJsValue
Source§fnfrom(o:JsTypedArray) -> Self
fnfrom(o:JsTypedArray) -> Self
Source§implFrom<JsUint16Array> forJsValue
implFrom<JsUint16Array> forJsValue
Source§fnfrom(o:JsUint16Array) -> Self
fnfrom(o:JsUint16Array) -> Self
Source§implFrom<JsUint32Array> forJsValue
implFrom<JsUint32Array> forJsValue
Source§fnfrom(o:JsUint32Array) -> Self
fnfrom(o:JsUint32Array) -> Self
Source§implFrom<JsUint8Array> forJsValue
implFrom<JsUint8Array> forJsValue
Source§fnfrom(o:JsUint8Array) -> Self
fnfrom(o:JsUint8Array) -> Self
Source§implFrom<JsUint8ClampedArray> forJsValue
implFrom<JsUint8ClampedArray> forJsValue
Source§fnfrom(o:JsUint8ClampedArray) -> Self
fnfrom(o:JsUint8ClampedArray) -> Self
Source§implFrom<PropertyKey> forJsValue
implFrom<PropertyKey> forJsValue
Source§fnfrom(property_key:PropertyKey) -> Self
fnfrom(property_key:PropertyKey) -> Self
Source§impl<A:TryIntoJsArguments, R:TryFromJs>From<TypedJsFunction<A, R>> forJsValue
impl<A:TryIntoJsArguments, R:TryFromJs>From<TypedJsFunction<A, R>> forJsValue
Source§fnfrom(o:TypedJsFunction<A, R>) -> Self
fnfrom(o:TypedJsFunction<A, R>) -> Self
Source§implTrace forJsValue
implTrace forJsValue
Source§unsafe fntrace_non_roots(&self)
unsafe fntrace_non_roots(&self)
Source§fnrun_finalizer(&self)
fnrun_finalizer(&self)
Finalize::finalize on this object and allcontained subobjects.implEq forJsValue
Auto Trait Implementations§
implFreeze forJsValue
impl !RefUnwindSafe forJsValue
impl !Send forJsValue
impl !Sync forJsValue
implUnpin forJsValue
impl !UnwindSafe forJsValue
Blanket Implementations§
Source§impl<T>BorrowMut<T> for Twhere T: ?Sized,
impl<T>BorrowMut<T> for Twhere T: ?Sized,
Source§fnborrow_mut(&mut self) ->&mut T
fnborrow_mut(&mut self) ->&mut T
Source§impl<T>CloneToUninit for Twhere T:Clone,
impl<T>CloneToUninit for Twhere T:Clone,
Source§impl<Q, K>Equivalent<K> for Q
impl<Q, K>Equivalent<K> for Q
Source§fnequivalent(&self, key:&K) ->bool
fnequivalent(&self, key:&K) ->bool
key and returntrue if they are equal.Source§impl<Q, K>Equivalent<K> for Q
impl<Q, K>Equivalent<K> for Q
Source§impl<T>IntoEither for T
impl<T>IntoEither for T
Source§fninto_either(self, into_left:bool) ->Either<Self, Self>
fninto_either(self, into_left:bool) ->Either<Self, Self>
self into aLeft variant ofEither<Self, Self>ifinto_left istrue.Convertsself into aRight variant ofEither<Self, Self>otherwise.Read moreSource§fninto_either_with<F>(self, into_left: F) ->Either<Self, Self>
fninto_either_with<F>(self, into_left: F) ->Either<Self, Self>
self into aLeft variant ofEither<Self, Self>ifinto_left(&self) returnstrue.Convertsself into aRight variant ofEither<Self, Self>otherwise.Read moreSource§impl<T>Pipe for Twhere T: ?Sized,
impl<T>Pipe for Twhere T: ?Sized,
Source§fnpipe<R>(self, func: implFnOnce(Self) -> R) -> Rwhere Self:Sized,
fnpipe<R>(self, func: implFnOnce(Self) -> R) -> Rwhere Self:Sized,
Source§fnpipe_ref<'a, R>(&'a self, func: implFnOnce(&'a Self) -> R) -> Rwhere R: 'a,
fnpipe_ref<'a, R>(&'a self, func: implFnOnce(&'a Self) -> R) -> Rwhere R: 'a,
self and passes that borrow into the pipe function.Read moreSource§fnpipe_ref_mut<'a, R>(&'a mut self, func: implFnOnce(&'a mut Self) -> R) -> Rwhere R: 'a,
fnpipe_ref_mut<'a, R>(&'a mut self, func: implFnOnce(&'a mut Self) -> R) -> Rwhere R: 'a,
self and passes that borrow into the pipe function.Read moreSource§fnpipe_borrow<'a, B, R>(&'a self, func: implFnOnce(&'a B) -> R) -> R
fnpipe_borrow<'a, B, R>(&'a self, func: implFnOnce(&'a B) -> R) -> R
Source§fnpipe_borrow_mut<'a, B, R>( &'a mut self, func: implFnOnce(&'a mut B) -> R,) -> R
fnpipe_borrow_mut<'a, B, R>( &'a mut self, func: implFnOnce(&'a mut B) -> R,) -> R
Source§fnpipe_as_ref<'a, U, R>(&'a self, func: implFnOnce(&'a U) -> R) -> R
fnpipe_as_ref<'a, U, R>(&'a self, func: implFnOnce(&'a U) -> R) -> R
self, then passesself.as_ref() into the pipe function.Source§fnpipe_as_mut<'a, U, R>(&'a mut self, func: implFnOnce(&'a mut U) -> R) -> R
fnpipe_as_mut<'a, U, R>(&'a mut self, func: implFnOnce(&'a mut U) -> R) -> R
self, then passesself.as_mut() into the pipefunction.Source§fnpipe_deref<'a, T, R>(&'a self, func: implFnOnce(&'a T) -> R) -> R
fnpipe_deref<'a, T, R>(&'a self, func: implFnOnce(&'a T) -> R) -> R
self, then passesself.deref() into the pipe function.Source§impl<T>Tap for T
impl<T>Tap for T
Source§fntap_borrow<B>(self, func: implFnOnce(&B)) -> Self
fntap_borrow<B>(self, func: implFnOnce(&B)) -> Self
Borrow<B> of a value.Read moreSource§fntap_borrow_mut<B>(self, func: implFnOnce(&mut B)) -> Self
fntap_borrow_mut<B>(self, func: implFnOnce(&mut B)) -> Self
BorrowMut<B> of a value.Read moreSource§fntap_ref<R>(self, func: implFnOnce(&R)) -> Self
fntap_ref<R>(self, func: implFnOnce(&R)) -> Self
AsRef<R> view of a value.Read moreSource§fntap_ref_mut<R>(self, func: implFnOnce(&mut R)) -> Self
fntap_ref_mut<R>(self, func: implFnOnce(&mut R)) -> Self
AsMut<R> view of a value.Read moreSource§fntap_deref<T>(self, func: implFnOnce(&T)) -> Self
fntap_deref<T>(self, func: implFnOnce(&T)) -> Self
Deref::Target of a value.Read moreSource§fntap_deref_mut<T>(self, func: implFnOnce(&mut T)) -> Self
fntap_deref_mut<T>(self, func: implFnOnce(&mut T)) -> Self
Deref::Target of a value.Read moreSource§fntap_dbg(self, func: implFnOnce(&Self)) -> Self
fntap_dbg(self, func: implFnOnce(&Self)) -> Self
.tap() only in debug builds, and is erased in release builds.Source§fntap_mut_dbg(self, func: implFnOnce(&mut Self)) -> Self
fntap_mut_dbg(self, func: implFnOnce(&mut Self)) -> Self
.tap_mut() only in debug builds, and is erased in releasebuilds.Source§fntap_borrow_dbg<B>(self, func: implFnOnce(&B)) -> Self
fntap_borrow_dbg<B>(self, func: implFnOnce(&B)) -> Self
.tap_borrow() only in debug builds, and is erased in releasebuilds.Source§fntap_borrow_mut_dbg<B>(self, func: implFnOnce(&mut B)) -> Self
fntap_borrow_mut_dbg<B>(self, func: implFnOnce(&mut B)) -> Self
.tap_borrow_mut() only in debug builds, and is erased in releasebuilds.Source§fntap_ref_dbg<R>(self, func: implFnOnce(&R)) -> Self
fntap_ref_dbg<R>(self, func: implFnOnce(&R)) -> Self
.tap_ref() only in debug builds, and is erased in releasebuilds.Source§fntap_ref_mut_dbg<R>(self, func: implFnOnce(&mut R)) -> Self
fntap_ref_mut_dbg<R>(self, func: implFnOnce(&mut R)) -> Self
.tap_ref_mut() only in debug builds, and is erased in releasebuilds.Source§fntap_deref_dbg<T>(self, func: implFnOnce(&T)) -> Self
fntap_deref_dbg<T>(self, func: implFnOnce(&T)) -> Self
.tap_deref() only in debug builds, and is erased in releasebuilds.