Trait static_reflect::StaticReflect [−][src]
The trait for types whose information can be accessed via static reflection.
In order to proper access any fields, the representation must be C-compatible. Otherwise, transmutes and pointer-arithmetic are pointless because they are already undefined behavior.
Safety
Incorrect implementation of this trait is considered undefined behavior. All the static type information must be correct at runtime.
For example, if this type gives field information via FieldReflect, then the field information must match the representation at runtime.
The advantage of this is that other crates can rely on the representation being stable (for example, JIT compilers can use it).
The type must be #[repr(C)]
or have some other
form of FFI safety.
Associated Constants
Loading content...Implementations on Foreign Types
impl<T: StaticReflect> StaticReflect for ManuallyDrop<T>
[src]
impl<T: StaticReflect> StaticReflect for ManuallyDrop<T>
[src]Support StaticReflect for ManuallyDrop by just representing the inner type
impl<T> StaticReflect for *mut T
[src]
impl<T> StaticReflect for *mut T
[src]A pointer
NOTE: The pointed-to value can be anything, even if it doesn’t implement StaticReflect.
This is fine since the static reflection system doesn’t maintain information about pointers (to avoid cycles).
impl<T> StaticReflect for *const T
[src]
impl<T> StaticReflect for *const T
[src]An immutable pointer
The static reflection system makes no distinction between mutable and immutable pointers.
impl<T: SimpleNonZeroPointer> StaticReflect for Option<T>
[src]
impl<T: SimpleNonZeroPointer> StaticReflect for Option<T>
[src]Implementors
impl<T: StaticReflect> StaticReflect for AsmOption<T>
[src]
impl<T: StaticReflect> StaticReflect for AsmOption<T>
[src]impl<T: StaticReflect> StaticReflect for AsmSlice<T>
[src]
impl<T: StaticReflect> StaticReflect for AsmSlice<T>
[src]