Skip to main content

Module object

Module object 

Source
Expand description

Objects: reference-counted values shared with C++ and Python, and the traits that define object types (ObjectCore) and their managed references (ObjectRefCore).

Structs§

Object
The root object type, ffi.Object: just the object header.
ObjectArc
A reference-counted pointer to an object T, as Arc<T>, counting with the object header so that every language shares the count.
ObjectIdentity
An owning, hashable identity key for an FFI object.
ObjectRef
A managed reference to an object of any type, the root of every object reference; downcast it to a concrete reference with ObjectRefCore::downcast.

Traits§

ImmutableObject
An object type whose shared instances are never mutated, so ObjectArc<T> is Send + Sync when T’s fields are.
ObjectCore
The native representation of an object-system type.
ObjectCoreWithExtraItems
An object type whose allocation is followed by a run of extra items, such as the dimensions of a Shape.
ObjectRefAnyCompatible
The AnyCompatible implementation of an object reference, with every hook defaulted: every implementer is AnyCompatible.
ObjectRefCore
A managed object reference, such as ObjectRef, Array<T> or a #[derive(ObjectRef)] type, with identity (same_as) and strict casts that check the runtime type and never convert; upcasts are From/Into.

Functions§

fmt_object_ref
Format a managed reference as its runtime type key and object address, as the Debug implementation of #[derive(ObjectRef)] does.
is_instance_of
Whether the runtime type index of an object is Target or one of its subtypes, by walking the registered type hierarchy.