pub trait ComponentInterface {
const UID: u64;
const COMPONENT_OFFSET: isize = 0;
}Expand description
A server interface reachable as a component, and the UID that finds it.
Implemented for the opaque interface handles (IObjectsComponent,
IVehiclesComponent, …). Tying the UID to the type is what Component
builds on: the lookup and the cast cannot disagree.
Required Associated Constants§
Provided Associated Constants§
Sourceconst COMPONENT_OFFSET: isize = 0
const COMPONENT_OFFSET: isize = 0
Where the IComponent subobject sits inside the interface.
The server hands out an IComponent*. For almost every component that
is the start of the object, because IComponent is the first base; for
INPCComponent the pool comes first and the IComponent sits after its
vtable pointer, so the pointer has to move back before the interface’s
own methods can be called through it. From clang’s record layout, per
ABI.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".