Skip to main content

JsObject

Struct JsObject 

Source
pub struct JsObject { /* private fields */ }
Expand description

A JavaScript object.

The interior mutability is what makes const o = {}; o.x = 1 work: the handle is immutable, the object it points at is not.

Implementations§

Source§

impl JsObject

Source

pub fn array_buffer_storage(&self) -> Option<Rc<RefCell<BufferStorage>>>

The storage of this object, when it is an ArrayBuffer.

Source

pub fn set_array_buffer(&self, storage: Rc<RefCell<BufferStorage>>)

Make this object an ArrayBuffer owning storage.

Source

pub fn collection_entries(&self) -> Option<Vec<(Value, Value)>>

The entries of this object, when it is a Map or a Set.

Source

pub fn collection_is_set(&self) -> Option<bool>

Whether this object is a Set rather than a Map.

Source

pub fn set_collection( &self, heap: &Heap, entries: Vec<(Value, Value)>, is_set: bool, )

Make this object a Map or Set holding entries.

Source

pub fn weak_entries(&self) -> Option<Vec<(Value, Value)>>

This object’s weak entries, when it is a WeakMap or WeakSet.

Expired handles are filtered out here rather than at the call site, so every reader sees the same live view of the map and a dead key can never be observed.

Source

pub fn weak_is_set(&self) -> Option<bool>

Whether this object is a WeakSet rather than a WeakMap.

Source

pub fn set_weak_collection( &self, heap: &Heap, entries: Vec<(WeakKey, Value)>, is_set: bool, )

Make this object a WeakMap or WeakSet, replacing any entries it had.

Source

pub fn weak_set(&self, key: WeakKey, value: Value)

Store one entry in a weak collection, replacing the value for a live equal key.

The comparison is pointer identity: a weak key has to be an object, and two objects are the same key exactly when they are the same object. Expired entries are dropped on the way through, which keeps the vector from growing without bound in a program that churns keys.

Source

pub fn weak_delete(&self, key: &Value) -> bool

Remove key from a weak collection, answering whether it was there.

Source

pub fn weak_ref_target(&self) -> Option<WeakKey>

The target of a WeakRef, when this object is one.

Source

pub fn set_weak_ref(&self, target: WeakKey)

Make this object a WeakRef to target.

Source

pub fn finalization_state(&self) -> Option<Box<FinalizationState>>

The registry state, when this object is a FinalizationRegistry.

Source

pub fn set_finalization_state(&self, state: FinalizationState)

Replace a registry’s state.

Source

pub fn typed_array_parts( &self, ) -> Option<(Gc<JsObject>, ElementType, usize, usize)>

(buffer, element, offset, length), when this object is a typed-array view.

The offset and length are effective: a view whose buffer has been resized out from under it answers (0, 0), and a length-tracking view answers what the buffer measures now — see [view_geometry].

Source

pub fn typed_array_geometry( &self, ) -> Option<(Gc<JsObject>, ElementType, usize, usize, bool)>

As JsObject::typed_array_parts, plus whether the view is out of bounds.

The extra flag cannot be recovered from the length: an empty view that legitimately sits at the end of its buffer is in bounds and answers 0, while a view that shrank away is out of bounds and also answers 0. Every method that runs ValidateTypedArray has to tell them apart, since one is allowed to return and the other has to throw.

Source

pub fn typed_array_stored( &self, ) -> Option<(Gc<JsObject>, ElementType, usize, ViewLength)>

The view’s stored geometry: (buffer, element, offset, length) as it was built, with no collapse for an out-of-bounds buffer.

Apart from JsObject::typed_array_geometry, which reports what a script sees, this is what subarray needs: §23.2.3.30 computes beginByteOffset from O.[[ByteOffset]], and that slot keeps its value when the buffer shrinks — so oobView.subarray(1) still starts at the original offset once the buffer grows back (subarray/result-byteOffset-from-out-of-bounds).

Source

pub fn typed_array_tracks_length(&self) -> bool

Whether this view’s length follows its buffer rather than being fixed.

Source

pub fn is_native_function(&self) -> bool

Whether this callable is a native function rather than compiled JavaScript.

construct uses it to decide who builds the instance: a native constructor creates its own, after validating its arguments.

Source

pub fn native_creates_own_instance(&self) -> bool

Whether this native constructor builds its own instance, so new must not pass one.

Source

pub fn set_data_view( &self, buffer: Gc<JsObject>, offset: usize, length: ViewLength, )

Make this object a DataView over buffer.

Source

pub fn is_array_buffer_view(&self) -> bool

Whether this object has a [[ViewedArrayBuffer]] internal slot.

Deliberately not typed_array_parts().is_some() || data_view_parts().is_some() written at each call site: ArrayBuffer.isView must answer false for a Proxy whose target is a view, because a Proxy has no such slot and [[Get]] is never reached. Keeping the predicate here means the “no proxy, no prototype” rule lives in one place.

Source

pub fn data_view_parts(&self) -> Option<(Gc<JsObject>, usize, usize)>

The (buffer, offset, length) of a DataView, or None when this is not one.

Like JsObject::typed_array_parts, the offset and length are effective: a DataView whose buffer shrank under it answers (0, 0).

Source

pub fn data_view_geometry(&self) -> Option<(Gc<JsObject>, usize, usize, bool)>

As JsObject::data_view_parts, plus whether the view is out of bounds.

Source

pub fn data_view_tracks_length(&self) -> bool

Whether this DataView’s length follows its buffer.

Source

pub fn set_typed_array( &self, buffer: Gc<JsObject>, element: ElementType, offset: usize, length: ViewLength, )

Make this object a typed-array view of length elements.

Source

pub fn typed_array_element_type(&self) -> Option<ElementType>

The element type, when this object is a typed-array view.

Source

pub fn typed_array_length(&self) -> Option<usize>

How many elements the view exposes, or None when this is not a view.

A detached or resized-away buffer reports 0: there is nothing to index. A length-tracking view reports what its buffer measures now, which is why this is computed rather than read.

Source

pub fn typed_array_element(&self, index: usize) -> Option<Value>

Read one view element.

Out-of-range and out-of-bounds reads are undefined rather than an error, which is what makes a[999], a[0] after the buffer shrank, and every read of a detached view behave the way the language says.

Source

pub fn typed_array_set( &self, index: usize, value: Value, ) -> Option<Result<(), &'static str>>

Store one view element, applying the type’s wrap or clamp.

Some(Ok(())) stored, Some(Err(())) refused the value — a Number into a BigInt view, which the caller turns into a TypeError — and None when this is not a view at all or the index is out of range, which is a silent no-op.

Source§

impl JsObject

Source

pub fn ordinary(heap: &Heap, proto: Option<Gc<JsObject>>) -> Gc<JsObject>

An ordinary object with the given prototype.

Source

pub fn array( heap: &Heap, proto: Option<Gc<JsObject>>, capacity: usize, ) -> Gc<JsObject>

An array with the given prototype and initial capacity. An empty array with room for capacity elements.

The length starts at 0: capacity is a Vec hint, not a length. Callers that want holes use Self::array_set_length, which no longer allocates them.

Source

pub fn host_object( heap: &Heap, proto: Option<Gc<JsObject>>, class_id: ClassId, class: Rc<ClassDef>, ) -> Gc<JsObject>

An instance of a host class (JS_NewObjectProtoClass).

The opaque starts null; the host fills it with JsObject::set_host_opaque, which is the order point.c uses (create the object, then hand it the payload) and the order that makes a finalizer’s “the opaqued may still be null” note true.

Source

pub fn is_host_class(&self) -> bool

Whether this object is an instance of a host class.

Source

pub fn host_class_id(&self) -> Option<ClassId>

This object’s class id, when it is a host class instance.

Source

pub fn host_class(&self) -> Option<Rc<ClassDef>>

The class definition this object belongs to, when it is a host class instance.

Source

pub fn exotic(&self) -> Option<Rc<dyn Exotic>>

The exotic methods of this object’s class, if it has a class and the class has any.

Cloned out of the object’s data rather than borrowed, because every caller is about to call back into the interpreter and the trap may reach this very object.

Source

pub fn host_opaque(&self) -> Option<Opaque>

The opaque payload, when this object is a host instance.

None distinguishes “not a host instance” from an instance whose JS_SetOpaque never ran, which is the distinction JS_GetOpaque versus JS_GetOpaque2 exists for: the first answers NULL for both, the second raises a TypeError for the class mismatch.

Source

pub fn set_host_opaque(&self, opaque: Opaque) -> bool

Store the opaque payload (JS_SetOpaque). Answers whether the object is a host instance at all.

Source

pub fn function( heap: &Heap, proto: Option<Gc<JsObject>>, callable: Callable, ) -> Gc<JsObject>

A callable object.

Source

pub fn with<R>(&self, f: impl FnOnce(&ObjectData) -> R) -> R

Run f with the object’s data borrowed.

Source

pub fn with_mut<R>(&self, f: impl FnOnce(&mut ObjectData) -> R) -> R

Run f with the object’s data mutably borrowed.

Source

pub fn is_callable(&self) -> bool

Whether this object can be called.

Covers every Callable variant, Bound included: typeof bound === "function" and bound() works, so from a script’s point of view a bound function is a function.

Source

pub fn is_constructor(&self) -> bool

Whether this object has a [[Construct]], i.e. may be the target of new or Reflect.construct.

Source

pub fn set_constructible(&self, yes: bool)

Give this function a [[Construct]].

Only for callables that are constructors by definition: ordinary functions, class constructors, and the built-in constructors. Everything else — methods, arrows, generators, async functions — keeps the default false.

Source

pub fn proxy_state(&self) -> Option<ProxyRef>

This object’s proxy slots, when it is one (revoked or not).

Source

pub fn proxy(heap: &Heap, target: Gc<JsObject>, handler: Value) -> Gc<JsObject>

A proxy over target reading its traps from handler.

The prototype stays empty on purpose: [[GetPrototypeOf]] on a proxy forwards to the target through the getPrototypeOf trap, so copying the target’s prototype here would be a second, disagreeing source of truth.

Source

pub fn proto(&self) -> Option<Gc<JsObject>>

The prototype.

Source

pub fn set_proto(&self, proto: Option<Gc<JsObject>>)

Replace the prototype.

Source

pub fn home_object(&self) -> Option<Gc<JsObject>>

The object a method was defined on, for super to resolve against.

Source

pub fn set_home_object(&self, home: Option<Gc<JsObject>>)

Record the object a method was defined on.

A method has no [[Construct]] (§10.2.1): new (o.m) is a TypeError even though o.m is a function. Acquiring a home object is exactly the moment a function becomes a method, so the flag is cleared here rather than left to every method-defining call site to remember.

Source

pub fn private_brand(&self) -> Option<Gc<JsSymbol>>

The brand symbol this object owns as a class home object, if it is one.

Source

pub fn set_private_brand(&self, symbol: Gc<JsSymbol>)

Record symbol as the brand this object owns.

Source

pub fn carries_brand(&self, symbol: &Gc<JsSymbol>) -> bool

Whether this object carries symbol among its brands.

This is the question check_brand asks of the receiver, and the one add_brand asks before adding — a second add_brand with the same symbol is the reference’s “private method is already present”.

Source

pub fn add_brand(&self, symbol: Gc<JsSymbol>)

Give this object the brand symbol.

Source

pub fn is_class_constructor(&self) -> bool

Whether this is a class constructor.

Source

pub fn set_class_constructor(&self, yes: bool)

Mark this function as a class constructor.

Source

pub fn array_elements(&self) -> Option<Vec<Value>>

The elements of an array object, if this is one.

Source

pub fn property_entries(&self) -> Vec<(PropertyKey, Property)>

Every own key with its descriptor, array indices included.

JsObject::own_property_keys answers the same question without the descriptors; a proxy invariant needs both at once, because it has to check the value of a key it is told about and the presence of a key it is not.

Source

pub fn is_array(&self) -> bool

Whether this object has array elements at all.

Source

pub fn regexp(&self) -> Option<RegExpData>

length for an array, reading it out of the element vector. The compiled pattern, when this object is a RegExp.

Source

pub fn disposable_stack(&self) -> Option<StackState>

The held resources, when this object is a DisposableStack.

Source

pub fn set_disposable_stack(&self, state: StackState)

Make this object a DisposableStack holding state.

Source

pub fn set_regexp(&self, data: RegExpData)

Make this object a RegExp carrying data.

Source

pub fn is_regexp(&self) -> bool

Whether this object is a RegExp.

Source

pub fn array_length(&self) -> Option<usize>

An array’s element count, when this object is an array.

Source

pub fn array_allocated(&self) -> usize

How many elements are actually allocated, which is at most the length.

Distinct from Self::array_length on purpose: new Array(5) has a length of 5 and nothing allocated, and the difference is what tells a store that fills a hole (it has to grow the vector) from one that overwrites an existing element.

Source

pub fn array_get(&self, index: usize) -> Option<Value>

Read one array element.

Source

pub fn array_push(&self, heap: &Heap, value: Value) -> usize

Append to an array and return the new length.

Source

pub fn array_set(&self, heap: &Heap, index: usize, value: Value) -> bool

Store into an array, and return whether the write happened.

The gap an out-of-range store leaves behind is filled with Value::Hole, not undefined: a = [1]; a[3] = 4 has holes at 1 and 2, which forEach skips and the debug printer reports. A store of undefined is a real element.

Source

pub fn array_store(&self, heap: &Heap, index: usize, value: Value) -> bool

Store an element, honouring its attributes, reporting whether it happened.

Array methods that write back (sort, reverse, splice, …) use this rather than Self::array_set: the spec has them go through [[Set]], so a frozen element makes them throw instead of being quietly overwritten.

Source

pub fn array_push_hole(&self, heap: &Heap) -> bool

Store value as a plain element without creating holes, used by push.

Source

pub fn array_set_length(&self, heap: &Heap, new_length: usize) -> bool

Set the length of an array, truncating or extending with holes.

a.length = 5 on a two-element array leaves three holes, so the fill value is Value::Hole rather than undefined. Growing only records the new length: the extra slots are holes, and a hole needs no storage. That is what makes a = []; a.length = 4294967295 an O(1) operation instead of a 62 GB allocation.

Source

pub fn array_truncate(&self, heap: &Heap, new_length: usize) -> bool

Truncate an array to length elements without extending it.

This is what arr.length = n does for n smaller than the current length; it is separate from Self::array_set_length because growing an array by assignment produces holes, which are indistinguishable from undefined here.

Source

pub fn own_property_key(&self, key: &PropertyKey) -> Option<Property>

The own data property key, if there is one.

Source

pub fn address(&self) -> usize

The address of this object, for an inline cache’s hash.

Only ever hashed, never dereferenced — and a hash collision is caught by the re-validation, never trusted. Compare a cached handle instead when identity matters.

Source

pub fn cached_property_at( &self, index: usize, key: &PropertyKey, expected_len: usize, ) -> Option<Value>

The data property at index, if the table still has key there as a plain value.

This is the read half of an inline cache: the caller remembers where a property was found on a particular object, and this re-checks the two things that could have changed — the entry moving (the table is a Vec, so a delete shifts it) and the property becoming an accessor. Re-checking is what makes the cache safe without shape/hidden-class machinery: there is no pointer arithmetic on a remembered index, only a bounds-checked lookup followed by an equality test. The value at index if the table still has the shape the entry recorded.

One borrow for what Self::props_len followed by Self::cached_data_property does with two, and it answers from a single lookup instead of two. That pair is the whole body of a monomorphic cache hit, so the extra RefCell borrow was per property read in every loop there is.

Source

pub fn cached_data_property( &self, index: usize, key: &PropertyKey, ) -> Option<Value>

The data property at index, if the table still has key there as a plain value.

The two-check form, for callers that have not already validated the table length. A cache hit on level 0 should use Self::cached_property_at, which folds the length check into the same borrow.

Source

pub fn data_property_at(&self, index: usize, name: &str) -> Option<Value>

The own data property at index, if the key there is still name.

The global-variable cache’s validation. The caller passes the name it is looking for and this compares it against the table’s entry — catching both the property being replaced by an accessor and the entry moving when a delete shifted the Vec.

It takes a &str rather than a PropertyKey on purpose: building a key allocates, and a cache that allocates on every hit is not a cache.

Source

pub fn write_data_at(&self, index: usize, name: &str, value: Value) -> bool

Store value at the own data property index, if the table still has name there as a writable data property.

The write half of Self::data_property_at, and it exists for the same reason the read half does: assigning to a global var went through set_property_with, which converts the name to a PropertyKey (two allocations) and then linearly scans the global object’s table — which holds every builtin. A loop body like s += 1 paid that on every iteration: measured with a counter, a 5-million-iteration loop assigning to a global made 20,000,036 own_property_key calls where the same loop over a local made 32.

Re-validation is the same pair the read half checks — the entry has not moved and is still a data property — plus writable, because a store has one more way to fail than a load.

Source

pub fn props_len(&self) -> usize

The number of own properties, for an inline cache’s invalidation guard.

A prototype-hit cache records this for every link of the chain it walked: adding or deleting any property moves it, which is what makes a stale entry a miss rather than a wrong answer.

Source

pub fn props_capacity(&self) -> usize

The property table’s allocated slot count.

The memory report wants capacity rather than length: the difference is memory the object is holding and nobody can see from Object.keys.

Source

pub fn with_kind<R>(&self, f: impl FnOnce(&ObjectKind) -> R) -> R

Run f on this object’s kind.

A closure rather than &ObjectKind, for the same reason JsString::wtf8 hands out a reference tied to &self: the kind lives behind a RefCell, so a borrow cannot outlive this call. Everything that needs to inspect rather than mutate goes through here.

Source

pub fn own_data_index(&self, name: &str) -> Option<usize>

The index of the own data property name, for filling a cache.

An accessor answers None — it must never be cached, because running its getter is the whole point of not caching it.

Source

pub fn own_property_index(&self, key: &PropertyKey) -> Option<(usize, Value)>

Where key sits in this object’s own property table, for caching.

Source

pub fn own_property(&self, name: &str) -> Option<Property>

The own data property name, if there is one.

Source

pub fn has_own_key(&self, key: &PropertyKey) -> bool

Whether the object has an own property key.

Source

pub fn has_own(&self, name: &str) -> bool

Whether the object has an own property name.

Source

pub fn define_key(&self, key: &PropertyKey, property: Property)

Define or replace an own property, keeping the original position when the key already exists.

Source

pub fn define(&self, name: &str, property: Property)

Define or replace an own property under a string key.

Source

pub fn define_data(&self, name: &str, value: Value)

Define an own data property, with the default attributes.

This creates: on an existing property it overwrites the attributes too, so it is the wrong call for a plain assignment. Use Self::write_value for that.

Source

pub fn define_data_key(&self, key: &PropertyKey, value: Value)

Define an own data property under key.

Source

pub fn write_value(&self, name: &str, value: Value) -> bool

Store a value into an existing own data property, keeping its attributes.

Returns false when the property is absent, is an accessor, or is not writable. An assignment has to go through this rather than Self::define_data, because redefining is how a non-configurable global silently became configurable again and started answering delete with true.

Source

pub fn write_value_key(&self, key: &PropertyKey, value: Value) -> bool

Store a value into an existing own data property under key.

Source

pub fn delete(&self, name: &str) -> bool

Delete an own property, reporting whether it was there and removable.

Source

pub fn delete_key(&self, key: &PropertyKey) -> bool

Delete an own property under key.

Source

pub fn is_extensible(&self) -> bool

Whether new properties may be added.

Source

pub fn set_extensible(&self, extensible: bool)

Make the object non-extensible.

Source

pub fn elements_writable(&self) -> bool

Whether array elements may be replaced.

Source

pub fn has_element_descriptors(&self) -> bool

Whether any element of this array has a descriptor of its own.

Until something has, JsObject::array_store may write the element vector directly; after, every store has to consult the property table for that index.

Source

pub fn note_element_descriptor(&self)

Record that an element now has a descriptor of its own.

Source

pub fn length_writable(&self) -> bool

Whether an array’s length may be changed.

Source

pub fn set_length_writable(&self, writable: bool)

Record whether length may be changed.

Source

pub fn set_elements_writable(&self, writable: bool)

Make array elements read-only, as Object.freeze does.

Source

pub fn element_attributes(&self, index: u32) -> Option<Property>

The attributes recorded for an array index, if defineProperty set any.

Source

pub fn element_is_undeletable(&self, index: u32) -> bool

Whether delete at index would be rejected.

Separate from JsObject::element_is_locked: a store needs the element to be non-writable, but a delete — which is what truncating an array does — only needs it to be non-configurable. Object.defineProperty(a, "3", {configurable: false}) leaves a[3] writable and yet undeletable, so a.length = 2 must fail.

Source

pub fn first_undeletable_at_or_above(&self, from: usize) -> Option<usize>

The lowest index at or above from whose element cannot be deleted.

Callers use this to refuse a shrinking length (§10.4.2.4 deletes every index at or above the new length, and a non-configurable one makes that impossible). Scanning from..length instead is what a sparse array turns into an hour-long loop: after x[2**32 - 2] = 1, x.length = 2 would ask element_is_undeletable four billion times. Only two things can be undeletable — a frozen object (every element) and an index with a recorded descriptor (a handful) — so this looks at exactly those.

Source

pub fn last_undeletable_at_or_above( &self, from: usize, below: usize, ) -> Option<usize>

The highest index in from..below whose element cannot be deleted.

The spec’s ArraySetLength walks down from the current length and stops at the first element it cannot delete, so the answer it needs is the last one.

Source

pub fn element_is_locked(&self, index: u32) -> bool

Whether a store at index would be rejected.

An element is locked either by Object.freeze on the whole object or by a non-configurable, non-writable descriptor recorded for that one index.

Source

pub fn own_keys(&self) -> Vec<Wtf8>

The own property names, in definition order. Symbol keys are excluded: Object.keys and for…in cannot see them.

Source

pub fn own_enumerable_keys(&self) -> Vec<Wtf8>

The own enumerable property names, in definition order.

Source

pub fn own_symbol_keys(&self) -> Vec<Gc<JsSymbol>>

The own symbol keys, in definition order, for Object.getOwnPropertySymbols.

Source

pub fn own_property_keys(&self) -> Vec<PropertyKey>

Every own key, strings first then symbols — the order Reflect.ownKeys and Object.getOwnPropertyDescriptors report, and the order JSON.stringify walks before it skips the symbols.

Source

pub fn own_property_keys_in_definition_order(&self) -> Vec<PropertyKey>

Own property keys in definition order, with symbols interleaved.

JsObject::own_property_keys answers in the spec’s order — integer-like keys ascending, then strings, then symbols — because that is what Reflect.ownKeys and for...in must do. A dumper has the opposite requirement: quickjs’s JS_PrintValue walks the shape, so {[Symbol("t")]: 1, y: 2} prints the symbol first. That is not observable from a script except through such a dump, which is why this is a separate accessor rather than a change to own_property_keys.

Source

pub fn chain(&self) -> Vec<Gc<JsObject>>

The prototype chain, starting with the prototypes of this object.

Trait Implementations§

Source§

impl Trace for JsObject

Source§

fn external_bytes(&self) -> usize

Everything this object holds that is not its own box: element slots, the property table, Map/Set entries, an ArrayBuffer’s bytes.

Counted by capacity, not length, because that is what the allocator actually holds — a 1000-element array with a 1024-slot vector costs 1024 slots, and reporting 1000 would make the limit wrong by whatever the vectors over-allocate (up to 2×).

Growth in place is reported to the heap as it happens (see JsObject::array_push and friends) and this same number is subtracted when the object is freed, which is why the two have to agree.

try_borrow because this can be called from inside the collector, where a mutation elsewhere in the engine may hold the borrow; a container that is being mutated at this instant is a container we cannot measure, and answering 0 for it is better than panicking mid-allocation.

Source§

fn trace(&self, tracer: &mut Tracer<'_>)

Report every Gc owned by self to tracer.

Auto Trait Implementations§

§

impl !Freeze for JsObject

§

impl !RefUnwindSafe for JsObject

§

impl !Send for JsObject

§

impl !Sync for JsObject

§

impl !UnwindSafe for JsObject

§

impl Forget for JsObject

§

impl Move for JsObject

§

impl Unpin for JsObject
where *const GcBox<JsObject> is !null: Unpin, *const u8 is !null: Unpin, Rc<[u8]>: Unpin, Rc<Vec<u8>>: Unpin, *const GcBox<JsSymbol> is !null: Unpin, *const GcBox<JsString> is !null: Unpin, *const GcBox<BigInt> is !null: Unpin, *const GcBox<CompiledCode> is !null: Unpin, *const GcBox<ClosureEnv> is !null: Unpin, Rc<RefCell<Box<dyn for<'i> FnMut(&mut Interp<'i>, Value, &[Value]) -> Result<Value, Signal>>>>: Unpin, Rc<RefCell<ProxyState>>: Unpin, *const GcBox<Cell> is !null: Unpin, Rc<Regex>: Unpin, Rc<RefCell<BufferStorage>>: Unpin, Box<GeneratorState>: Unpin, Rc<RefCell<PromiseState>>: Unpin, Box<FinalizationState>: Unpin, Box<HostData>: Unpin,

§

impl UnsafeUnpin for JsObject
where *const GcBox<JsObject> is !null: UnsafeUnpin, *const u8 is !null: UnsafeUnpin, PhantomData<(PropertyKey, Property)>: UnsafeUnpin, PhantomData<Value>: UnsafeUnpin, *const GcBox<CompiledCode> is !null: UnsafeUnpin, *const GcBox<ClosureEnv> is !null: UnsafeUnpin, *const GcBox<JsString> is !null: UnsafeUnpin, *const GcBox<JsSymbol> is !null: UnsafeUnpin, *const GcBox<BigInt> is !null: UnsafeUnpin, *const RcInner<RefCell<Box<dyn for<'i> FnMut(&mut Interp<'i>, Value, &[Value]) -> Result<Value, Signal>>>> is !null: UnsafeUnpin, PhantomData<RcInner<RefCell<Box<dyn for<'i> FnMut(&mut Interp<'i>, Value, &[Value]) -> Result<Value, Signal>>>>>: UnsafeUnpin, *const RcInner<RefCell<ProxyState>> is !null: UnsafeUnpin, PhantomData<RcInner<RefCell<ProxyState>>>: UnsafeUnpin, *const GcBox<Cell> is !null: UnsafeUnpin, *const RcInner<Regex> is !null: UnsafeUnpin, PhantomData<RcInner<Regex>>: UnsafeUnpin, PhantomData<u8>: UnsafeUnpin, PhantomData<(Value, Value)>: UnsafeUnpin, *const RcInner<RefCell<BufferStorage>> is !null: UnsafeUnpin, PhantomData<RcInner<RefCell<BufferStorage>>>: UnsafeUnpin, *const GeneratorState is !null: UnsafeUnpin, PhantomData<GeneratorState>: UnsafeUnpin, *const RcInner<RefCell<PromiseState>> is !null: UnsafeUnpin, PhantomData<RcInner<RefCell<PromiseState>>>: UnsafeUnpin, PhantomData<(WeakKey, Value)>: UnsafeUnpin, *const FinalizationState is !null: UnsafeUnpin, PhantomData<FinalizationState>: UnsafeUnpin, *const HostData is !null: UnsafeUnpin, PhantomData<HostData>: UnsafeUnpin, PhantomData<Gc<JsSymbol>>: UnsafeUnpin,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.