pub unsafe trait HasListLinks<const ID: u64 = 0> {
const OFFSET: usize;
// Provided method
unsafe fn raw_get_list_links(ptr: *mut Self) -> *mut ListLinks<ID> { ... }
}Expand description
Declares that this type has a ListLinks<ID> field at a fixed offset.
This trait is only used to help implement ListItem safely. If ListItem is implemented
manually, then this trait is not needed. Use the impl_has_list_links! macro to implement
this trait.
§Safety
All values of this type must have a ListLinks<ID> field at the given offset.
The behavior of raw_get_list_links must not be changed.
Required Associated Constants§
Provided Methods§
Sourceunsafe fn raw_get_list_links(ptr: *mut Self) -> *mut ListLinks<ID>
unsafe fn raw_get_list_links(ptr: *mut Self) -> *mut ListLinks<ID>
Returns a pointer to the ListLinks<T, ID> field.
§Safety
The provided pointer must point at a valid struct of type Self.
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.