pub unsafe trait Field<Base> {
type Type: ?Sized;
const NAME: &'static str;
// Required method
unsafe fn map(ptr: *const Base) -> *const Self::Type;
}
Expand description
Information of a field of struct Base
.
§Safety
The field must represent a field named NAME
in a type Base
that has the type Type
.
The map
function must be implemented such that it returns a pointer to the field.
This trait should not be implemented manually; instead, use the #[derive(Field)]
instead.
Required Associated Constants§
Required Associated Types§
Required Methods§
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.